Skip to content

Commit

Permalink
build: try to use @/ paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Oct 5, 2023
1 parent b3d2f52 commit 7d3eca2
Show file tree
Hide file tree
Showing 658 changed files with 3,305 additions and 3,193 deletions.
2 changes: 1 addition & 1 deletion core/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"madge-check": "yarn madge --circular lib/servers/graphql-main-server.js",
"eslint-check": "eslint \"{src,test}/**/*.ts\"",
"eslint-fix": "eslint \"{src,test}/**/*.ts\" --fix",
"build": "tsc -p tsconfig-build.json && cp -R src/services/price/protos lib/services/price/ && cp -R src/services/dealer-price/proto lib/services/dealer-price/ && cp -R src/services/loopd/protos lib/services/loopd/ && cp -R src/services/bria/proto lib/services/bria/ && tscpaths --silent -p tsconfig.json -s ./src -o ./lib",
"build": "tsc -p tsconfig-build.json && cp -R src/services/price/protos lib/services/price/ && cp -R src/services/dealer-price/proto lib/services/dealer-price/ && cp -R src/services/loopd/protos lib/services/loopd/ && cp -R src/services/bria/proto lib/services/bria/",
"trigger": "yarn build && node lib/servers/trigger.js | pino-pretty -c -l",
"check:sdl": ". ../../.env && yarn write-sdl && if git diff --name-only | grep -q 'core/api/src/graphql/admin/schema.graphql'; then echo 'Error: core/api/src/graphql/admin/schema.graphql has changes, run `make codegen` and re-recommit' >&2; exit 1; fi && if git diff --name-only | grep -q 'core/api/src/graphql/public/schema.graphql'; then echo 'Error: core/api/src/graphql/public/schema.graphql has changes, run `make codegen` and re-recommit' >&2; exit 1; fi",
"write-sdl": "yarn build && node lib/servers/write-sdl.js write-sdl.yaml && rover supergraph compose --config dev/apollo-federation/supergraph-config.yaml --elv2-license accept > dev/apollo-federation/supergraph.graphql",
Expand Down
10 changes: 5 additions & 5 deletions core/api/src/app/accounts/account-limit.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { getAccountLimits, ONE_DAY } from "@config"
import { getAccountLimits, ONE_DAY } from "@/config"

import {
AccountLimitsType,
AccountTxVolumeLimitChecker,
AccountTxVolumeRemaining,
} from "@domain/accounts"
import { InvalidAccountLimitTypeError } from "@domain/errors"
} from "@/domain/accounts"
import { InvalidAccountLimitTypeError } from "@/domain/errors"

import * as LedgerFacade from "@services/ledger/facade"
import { AccountsRepository, WalletsRepository } from "@services/mongoose"
import * as LedgerFacade from "@/services/ledger/facade"
import { AccountsRepository, WalletsRepository } from "@/services/mongoose"

export const remainingIntraLedgerLimit = async ({
accountId,
Expand Down
16 changes: 8 additions & 8 deletions core/api/src/app/accounts/active-accounts.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { USER_ACTIVENESS_MONTHLY_VOLUME_THRESHOLD } from "@config"
import { USER_ACTIVENESS_MONTHLY_VOLUME_THRESHOLD } from "@/config"

import { getCurrentPriceAsWalletPriceRatio } from "@app/prices"
import { getCurrentPriceAsWalletPriceRatio } from "@/app/prices"

import { ErrorLevel } from "@domain/shared"
import { ActivityChecker } from "@domain/ledger"
import { ErrorLevel } from "@/domain/shared"
import { ActivityChecker } from "@/domain/ledger"

import * as LedgerFacade from "@services/ledger/facade"
import { recordExceptionInCurrentSpan } from "@services/tracing"
import { WalletsRepository, AccountsRepository } from "@services/mongoose"
import { UsdDisplayCurrency } from "@domain/fiat"
import * as LedgerFacade from "@/services/ledger/facade"
import { recordExceptionInCurrentSpan } from "@/services/tracing"
import { WalletsRepository, AccountsRepository } from "@/services/mongoose"
import { UsdDisplayCurrency } from "@/domain/fiat"

export const getRecentlyActiveAccounts = async function* ():
| AsyncGenerator<Account>
Expand Down
2 changes: 1 addition & 1 deletion core/api/src/app/accounts/add-new-contact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountsRepository } from "@services/mongoose"
import { AccountsRepository } from "@/services/mongoose"

export const addNewContact = async ({
accountId,
Expand Down
2 changes: 1 addition & 1 deletion core/api/src/app/accounts/add-wallet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WalletsRepository } from "@services/mongoose"
import { WalletsRepository } from "@/services/mongoose"

export const addWallet = async ({
accountId,
Expand Down
8 changes: 4 additions & 4 deletions core/api/src/app/accounts/create-account.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ConfigError, getAdminAccounts, getDefaultAccountsConfig } from "@config"
import { ConfigError, getAdminAccounts, getDefaultAccountsConfig } from "@/config"

import { WalletType } from "@domain/wallets"
import { AccountLevel } from "@domain/accounts"
import { WalletType } from "@/domain/wallets"
import { AccountLevel } from "@/domain/accounts"

import {
AccountsRepository,
UsersRepository,
WalletsRepository,
} from "@services/mongoose"
} from "@/services/mongoose"

const initializeCreatedAccount = async ({
account,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/delete-business-map-info.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkedToUsername } from "@domain/accounts"
import { AccountsRepository } from "@services/mongoose/accounts"
import { checkedToUsername } from "@/domain/accounts"
import { AccountsRepository } from "@/services/mongoose/accounts"

export const deleteBusinessMapInfo = async ({
username,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/disable-notification-category.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
checkedToNotificationCategory,
disableNotificationCategory as domainDisableNotificationCategory,
} from "@domain/notifications"
import { AccountsRepository } from "@services/mongoose"
} from "@/domain/notifications"
import { AccountsRepository } from "@/services/mongoose"

export const disableNotificationCategory = async ({
accountId,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/disable-notification-channel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { disableNotificationChannel as domainDisableNotificationChannel } from "@domain/notifications"
import { AccountsRepository } from "@services/mongoose"
import { disableNotificationChannel as domainDisableNotificationChannel } from "@/domain/notifications"
import { AccountsRepository } from "@/services/mongoose"

export const disableNotificationChannel = async ({
accountId,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/enable-notification-category.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
checkedToNotificationCategory,
enableNotificationCategory as domainEnableNotificationCategory,
} from "@domain/notifications"
import { AccountsRepository } from "@services/mongoose"
} from "@/domain/notifications"
import { AccountsRepository } from "@/services/mongoose"

export const enableNotificationCategory = async ({
accountId,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/enable-notification-channel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { enableNotificationChannel as domainEnableNotificationChannel } from "@domain/notifications"
import { AccountsRepository } from "@services/mongoose"
import { enableNotificationChannel as domainEnableNotificationChannel } from "@/domain/notifications"
import { AccountsRepository } from "@/services/mongoose"

export const enableNotificationChannel = async ({
accountId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { memoSharingConfig } from "@config"
import { LedgerError } from "@domain/ledger"
import { WalletTransactionHistory } from "@domain/wallets"
import { memoSharingConfig } from "@/config"
import { LedgerError } from "@/domain/ledger"
import { WalletTransactionHistory } from "@/domain/wallets"

import { getNonEndUserWalletIds, LedgerService } from "@services/ledger"
import { WalletsRepository } from "@services/mongoose"
import { getNonEndUserWalletIds, LedgerService } from "@/services/ledger"
import { WalletsRepository } from "@/services/mongoose"

export const getAccountTransactionsForContact = async ({
account,
Expand Down
2 changes: 1 addition & 1 deletion core/api/src/app/accounts/get-contact-by-username.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NoContactForUsernameError } from "@domain/errors"
import { NoContactForUsernameError } from "@/domain/errors"

export const getContactByUsername = async ({
account,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/get-csv-for-account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CsvWalletsExport } from "@services/ledger/csv-wallet-export"
import { WalletsRepository } from "@services/mongoose"
import { CsvWalletsExport } from "@/services/ledger/csv-wallet-export"
import { WalletsRepository } from "@/services/mongoose"

export const getCSVForAccount = async (
accountId: AccountId,
Expand Down
9 changes: 5 additions & 4 deletions core/api/src/app/accounts/get-transactions-for-account.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { AccountValidator } from "@domain/accounts"
import { RepositoryError } from "@domain/errors"
import { WalletsRepository } from "@services/mongoose"

import { getTransactionsForWallets } from "../wallets"

import { PartialResult } from "../partial-result"

import { AccountValidator } from "@/domain/accounts"
import { RepositoryError } from "@/domain/errors"
import { WalletsRepository } from "@/services/mongoose"

export const getTransactionsForAccountByWalletIds = async ({
account,
walletIds,
Expand Down
2 changes: 1 addition & 1 deletion core/api/src/app/accounts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountsRepository, WalletsRepository } from "@services/mongoose"
import { AccountsRepository, WalletsRepository } from "@/services/mongoose"

export * from "./account-limit"
export * from "./add-new-contact"
Expand Down
12 changes: 6 additions & 6 deletions core/api/src/app/accounts/mark-account-for-deletion.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getBalanceForWallet, listWalletsByAccountId } from "@app/wallets"
import { AccountStatus } from "@domain/accounts"
import { AccountHasPositiveBalanceError } from "@domain/authentication/errors"
import { IdentityRepository } from "@services/kratos"
import { AccountsRepository, UsersRepository } from "@services/mongoose"
import { addEventToCurrentSpan } from "@services/tracing"
import { getBalanceForWallet, listWalletsByAccountId } from "@/app/wallets"
import { AccountStatus } from "@/domain/accounts"
import { AccountHasPositiveBalanceError } from "@/domain/authentication/errors"
import { IdentityRepository } from "@/services/kratos"
import { AccountsRepository, UsersRepository } from "@/services/mongoose"
import { addEventToCurrentSpan } from "@/services/tracing"

export const markAccountForDeletion = async ({
accountId,
Expand Down
22 changes: 11 additions & 11 deletions core/api/src/app/accounts/send-default-wallet-balance-to-users.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { getRecentlyActiveAccounts } from "./active-accounts"

import {
getCurrentPriceAsDisplayPriceRatio,
getCurrentPriceAsWalletPriceRatio,
} from "@app/prices"
import { removeDeviceTokens } from "@app/users/remove-device-tokens"
} from "@/app/prices"
import { removeDeviceTokens } from "@/app/users/remove-device-tokens"

import { UsdDisplayCurrency } from "@domain/fiat"
import { WalletCurrency } from "@domain/shared"
import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications"
import { UsdDisplayCurrency } from "@/domain/fiat"
import { WalletCurrency } from "@/domain/shared"
import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications"

import { LedgerService } from "@services/ledger"
import { wrapAsyncToRunInSpan } from "@services/tracing"
import { NotificationsService } from "@services/notifications"
import { WalletsRepository, UsersRepository } from "@services/mongoose"

import { getRecentlyActiveAccounts } from "./active-accounts"
import { LedgerService } from "@/services/ledger"
import { wrapAsyncToRunInSpan } from "@/services/tracing"
import { NotificationsService } from "@/services/notifications"
import { WalletsRepository, UsersRepository } from "@/services/mongoose"

export const sendDefaultWalletBalanceToAccounts = async () => {
const accounts = getRecentlyActiveAccounts()
Expand Down
8 changes: 4 additions & 4 deletions core/api/src/app/accounts/set-username.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { usernameAvailable } from "./username-available"

import {
checkedToUsername,
UsernameIsImmutableError,
UsernameNotAvailableError,
} from "@domain/accounts"
import { AccountsRepository } from "@services/mongoose"

import { usernameAvailable } from "./username-available"
} from "@/domain/accounts"
import { AccountsRepository } from "@/services/mongoose"

export const setUsername = async ({
id,
Expand Down
16 changes: 8 additions & 8 deletions core/api/src/app/accounts/update-account-ip.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { getIpConfig } from "@config"
import { isPrivateIp } from "@domain/accounts-ips"
import { CouldNotFindAccountIpError, RepositoryError } from "@domain/errors"
import { IpFetcherServiceError } from "@domain/ipfetcher"
import { ErrorLevel } from "@domain/shared"
import { IpFetcher } from "@services/ipfetcher"
import { AccountsIpsRepository } from "@services/mongoose/accounts-ips"
import { getIpConfig } from "@/config"
import { isPrivateIp } from "@/domain/accounts-ips"
import { CouldNotFindAccountIpError, RepositoryError } from "@/domain/errors"
import { IpFetcherServiceError } from "@/domain/ipfetcher"
import { ErrorLevel } from "@/domain/shared"
import { IpFetcher } from "@/services/ipfetcher"
import { AccountsIpsRepository } from "@/services/mongoose/accounts-ips"
import {
addAttributesToCurrentSpan,
recordExceptionInCurrentSpan,
} from "@services/tracing"
} from "@/services/tracing"

const accountsIps = AccountsIpsRepository()

Expand Down
2 changes: 1 addition & 1 deletion core/api/src/app/accounts/update-account-level.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountsRepository } from "@services/mongoose"
import { AccountsRepository } from "@/services/mongoose"

export const updateAccountLevel = async ({
id,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/update-account-status.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkedAccountStatus, checkedToAccountId } from "@domain/accounts"
import { AccountsRepository } from "@services/mongoose"
import { checkedAccountStatus, checkedToAccountId } from "@/domain/accounts"
import { AccountsRepository } from "@/services/mongoose"

export const updateAccountStatus = async ({
id: idRaw,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/update-account-withdraw-fee.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sanityCheckedDefaultAccountWithdrawFee } from "@domain/accounts"
import { AccountsRepository } from "@services/mongoose"
import { sanityCheckedDefaultAccountWithdrawFee } from "@/domain/accounts"
import { AccountsRepository } from "@/services/mongoose"

export const updateAccountWithdrawFee = async ({
id,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/update-business-map-info.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkedCoordinates, checkedMapTitle, checkedToUsername } from "@domain/accounts"
import { AccountsRepository } from "@services/mongoose/accounts"
import { checkedCoordinates, checkedMapTitle, checkedToUsername } from "@/domain/accounts"
import { AccountsRepository } from "@/services/mongoose/accounts"

export const updateBusinessMapInfo = async ({
username,
Expand Down
6 changes: 3 additions & 3 deletions core/api/src/app/accounts/update-contact-alias.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { checkedToContactAlias } from "@domain/accounts"
import { ContactNotExistentError } from "@domain/errors"
import { AccountsRepository } from "@services/mongoose"
import { checkedToContactAlias } from "@/domain/accounts"
import { ContactNotExistentError } from "@/domain/errors"
import { AccountsRepository } from "@/services/mongoose"

export const updateContactAlias = async ({
accountId,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/update-default-walletid.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InvalidWalletId } from "@domain/errors"
import { AccountsRepository, WalletsRepository } from "@services/mongoose"
import { InvalidWalletId } from "@/domain/errors"
import { AccountsRepository, WalletsRepository } from "@/services/mongoose"

export const updateDefaultWalletId = async ({
accountId,
Expand Down
8 changes: 4 additions & 4 deletions core/api/src/app/accounts/update-display-currency.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { listCurrencies } from "@app/prices"
import { listCurrencies } from "@/app/prices"

import { checkedToDisplayCurrency } from "@domain/fiat"
import { InvalidPriceCurrencyError } from "@domain/price"
import { checkedToDisplayCurrency } from "@/domain/fiat"
import { InvalidPriceCurrencyError } from "@/domain/price"

import { AccountsRepository } from "@services/mongoose"
import { AccountsRepository } from "@/services/mongoose"

export const updateDisplayCurrency = async ({
accountId,
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/app/accounts/upgrade-device-account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountLevel } from "@domain/accounts"
import { AccountsRepository, UsersRepository } from "@services/mongoose"
import { AccountLevel } from "@/domain/accounts"
import { AccountsRepository, UsersRepository } from "@/services/mongoose"

export const upgradeAccountFromDeviceToPhone = async ({
userId,
Expand Down
6 changes: 3 additions & 3 deletions core/api/src/app/accounts/username-available.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { checkedToUsername } from "@domain/accounts"
import { CouldNotFindError } from "@domain/errors"
import { AccountsRepository } from "@services/mongoose"
import { checkedToUsername } from "@/domain/accounts"
import { CouldNotFindError } from "@/domain/errors"
import { AccountsRepository } from "@/services/mongoose"

export const usernameAvailable = async (
username: Username,
Expand Down
12 changes: 7 additions & 5 deletions core/api/src/app/admin/backup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { Storage } from "@google-cloud/storage"

import axios from "axios"

import {
DROPBOX_ACCESS_TOKEN,
GCS_APPLICATION_CREDENTIALS_PATH,
Expand All @@ -6,17 +10,15 @@ import {
NEXTCLOUD_PASSWORD,
NEXTCLOUD_URL,
NEXTCLOUD_USER,
} from "@config"
import { ErrorLevel } from "@domain/shared"
import { Storage } from "@google-cloud/storage"
} from "@/config"
import { ErrorLevel } from "@/domain/shared"
import {
SemanticAttributes,
addAttributesToCurrentSpan,
addEventToCurrentSpan,
asyncRunInSpan,
recordExceptionInCurrentSpan,
} from "@services/tracing"
import axios from "axios"
} from "@/services/tracing"

export const uploadBackup =
(logger: Logger) =>
Expand Down
6 changes: 3 additions & 3 deletions core/api/src/app/admin/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export * from "./update-user-phone"
export * from "./send-admin-push-notification"

import { checkedToAccountUuid, checkedToUsername } from "@domain/accounts"
import { IdentityRepository } from "@services/kratos"
import { AccountsRepository, UsersRepository } from "@services/mongoose"
import { checkedToAccountUuid, checkedToUsername } from "@/domain/accounts"
import { IdentityRepository } from "@/services/kratos"
import { AccountsRepository, UsersRepository } from "@/services/mongoose"

export const getAccountByUsername = async (username: string) => {
const usernameValid = checkedToUsername(username)
Expand Down
Loading

0 comments on commit 7d3eca2

Please sign in to comment.