From 7910528a6f363c3da655c8b54d21f0ca200df294 Mon Sep 17 00:00:00 2001
From: clauspeterhuebner
Date: Mon, 25 Aug 2025 16:55:29 +0200
Subject: [PATCH] reorg all imports in core to relative pathes
---
.../resolver/ContributionResolver.test.ts | 2 +-
.../resolver/TransactionLinkResolver.ts | 1 +
.../src/graphql/resolver/UserResolver.test.ts | 2 +-
.../federation/client/1_0/SendCoinsClient.ts | 6 +++---
.../1_0/logging/SendCoinsArgsLogging.view.ts | 2 +-
.../logging/SendCoinsResultLogging.view.ts | 2 +-
.../federation/client/1_1/SendCoinsClient.ts | 2 +-
.../client/SendCoinsClientFactory.ts | 6 +++---
core/src/graphql/logging/DecayLogging.view.ts | 2 +-
.../logic/interpretEncryptedTransferArgs.ts | 4 ++--
.../src/graphql/logic/processXComSendCoins.ts | 20 +++++++++----------
.../logic/settlePendingSenderTransaction.ts | 2 +-
core/src/graphql/logic/storeForeignUser.ts | 4 ++--
core/src/util/calculateSenderBalance.ts | 2 +-
core/tsconfig.json | 2 +-
15 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/backend/src/graphql/resolver/ContributionResolver.test.ts b/backend/src/graphql/resolver/ContributionResolver.test.ts
index 14dfa614f..6dee20592 100644
--- a/backend/src/graphql/resolver/ContributionResolver.test.ts
+++ b/backend/src/graphql/resolver/ContributionResolver.test.ts
@@ -50,7 +50,7 @@ import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
import { peterLustig } from '@/seeds/users/peter-lustig'
import { raeuberHotzenplotz } from '@/seeds/users/raeuber-hotzenplotz'
import { stephenHawking } from '@/seeds/users/stephen-hawking'
-import { getFirstDayOfPreviousNMonth } from '@/util/utilities'
+import { getFirstDayOfPreviousNMonth } from 'core'
import { getLogger } from 'config-schema/test/testSetup'
import { getLogger as originalGetLogger } from 'log4js'
diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.ts b/backend/src/graphql/resolver/TransactionLinkResolver.ts
index 28375bcab..532cfec2f 100644
--- a/backend/src/graphql/resolver/TransactionLinkResolver.ts
+++ b/backend/src/graphql/resolver/TransactionLinkResolver.ts
@@ -8,6 +8,7 @@ import { ContributionStatus } from '@enum/ContributionStatus'
import { ContributionType } from '@enum/ContributionType'
import { ContributionLink } from '@model/ContributionLink'
import { RedeemJwtLink } from '@model/RedeemJwtLink'
+import { Community } from '@model/Community'
import { TransactionLink, TransactionLinkResult } from '@model/TransactionLink'
import { User } from '@model/User'
import { QueryLinkResult } from '@union/QueryLinkResult'
diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts
index bf2cb1f59..64817bd3e 100644
--- a/backend/src/graphql/resolver/UserResolver.test.ts
+++ b/backend/src/graphql/resolver/UserResolver.test.ts
@@ -65,7 +65,7 @@ import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
import { peterLustig } from '@/seeds/users/peter-lustig'
import { stephenHawking } from '@/seeds/users/stephen-hawking'
import { printTimeDuration } from '@/util/time'
-import { objectValuesToArray } from '@/util/utilities'
+import { objectValuesToArray } from 'core'
import { LOG4JS_BASE_CATEGORY_NAME } from '@/config/const'
import { getLogger } from 'config-schema/test/testSetup'
diff --git a/core/src/federation/client/1_0/SendCoinsClient.ts b/core/src/federation/client/1_0/SendCoinsClient.ts
index bb8d2c858..a872c438d 100644
--- a/core/src/federation/client/1_0/SendCoinsClient.ts
+++ b/core/src/federation/client/1_0/SendCoinsClient.ts
@@ -1,15 +1,15 @@
import { FederatedCommunity as DbFederatedCommunity } from 'database'
import { GraphQLClient } from 'graphql-request'
-import { ensureUrlEndsWithSlash } from '@/util/utilities'
+import { ensureUrlEndsWithSlash } from '../../../util/utilities'
import { getLogger } from 'log4js'
-import { LOG4JS_BASE_CATEGORY_NAME } from '@/config/const'
+import { LOG4JS_BASE_CATEGORY_NAME } from '../../../config/const'
import { revertSendCoins as revertSendCoinsQuery } from './query/revertSendCoins'
import { revertSettledSendCoins as revertSettledSendCoinsQuery } from './query/revertSettledSendCoins'
import { settleSendCoins as settleSendCoinsQuery } from './query/settleSendCoins'
import { voteForSendCoins as voteForSendCoinsQuery } from './query/voteForSendCoins'
-import { EncryptedTransferArgs } from '@graphql/model/EncryptedTransferArgs'
+import { EncryptedTransferArgs } from '../../../graphql/model/EncryptedTransferArgs'
const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.federation.client.1_0.SendCoinsClient`)
diff --git a/core/src/federation/client/1_0/logging/SendCoinsArgsLogging.view.ts b/core/src/federation/client/1_0/logging/SendCoinsArgsLogging.view.ts
index 1db8c2887..11afa4346 100644
--- a/core/src/federation/client/1_0/logging/SendCoinsArgsLogging.view.ts
+++ b/core/src/federation/client/1_0/logging/SendCoinsArgsLogging.view.ts
@@ -1,6 +1,6 @@
import { AbstractLoggingView } from 'database'
-import { SendCoinsArgs } from '@federation/client/1_0/model/SendCoinsArgs'
+import { SendCoinsArgs } from '../model/SendCoinsArgs'
export class SendCoinsArgsLoggingView extends AbstractLoggingView {
public constructor(private self: SendCoinsArgs) {
diff --git a/core/src/federation/client/1_0/logging/SendCoinsResultLogging.view.ts b/core/src/federation/client/1_0/logging/SendCoinsResultLogging.view.ts
index 383f4fd37..1eb08c432 100644
--- a/core/src/federation/client/1_0/logging/SendCoinsResultLogging.view.ts
+++ b/core/src/federation/client/1_0/logging/SendCoinsResultLogging.view.ts
@@ -1,6 +1,6 @@
import { AbstractLoggingView } from 'database'
-import { SendCoinsResult } from '@federation/client/1_0/model/SendCoinsResult'
+import { SendCoinsResult } from '../model/SendCoinsResult'
export class SendCoinsResultLoggingView extends AbstractLoggingView {
public constructor(private self: SendCoinsResult) {
diff --git a/core/src/federation/client/1_1/SendCoinsClient.ts b/core/src/federation/client/1_1/SendCoinsClient.ts
index 8c7f9caec..b0eab7c0c 100644
--- a/core/src/federation/client/1_1/SendCoinsClient.ts
+++ b/core/src/federation/client/1_1/SendCoinsClient.ts
@@ -1,3 +1,3 @@
-import { SendCoinsClient as V1_0_SendCoinsClient } from '@federation/client/1_0/SendCoinsClient'
+import { SendCoinsClient as V1_0_SendCoinsClient } from '../1_0/SendCoinsClient'
export class SendCoinsClient extends V1_0_SendCoinsClient {}
diff --git a/core/src/federation/client/SendCoinsClientFactory.ts b/core/src/federation/client/SendCoinsClientFactory.ts
index 8251da3cb..4a2772175 100644
--- a/core/src/federation/client/SendCoinsClientFactory.ts
+++ b/core/src/federation/client/SendCoinsClientFactory.ts
@@ -1,8 +1,8 @@
import { FederatedCommunity as DbFederatedCommunity } from 'database'
-import { SendCoinsClient as V1_0_SendCoinsClient } from '@federation/client/1_0/SendCoinsClient'
-import { SendCoinsClient as V1_1_SendCoinsClient } from '@federation/client/1_1/SendCoinsClient'
-import { ApiVersionType } from '@federation/enum/apiVersionType'
+import { SendCoinsClient as V1_0_SendCoinsClient } from './1_0/SendCoinsClient'
+import { SendCoinsClient as V1_1_SendCoinsClient } from './1_1/SendCoinsClient'
+import { ApiVersionType } from '../enum/apiVersionType'
type SendCoinsClient = V1_0_SendCoinsClient | V1_1_SendCoinsClient
diff --git a/core/src/graphql/logging/DecayLogging.view.ts b/core/src/graphql/logging/DecayLogging.view.ts
index f4f20ab6f..2c485447a 100644
--- a/core/src/graphql/logging/DecayLogging.view.ts
+++ b/core/src/graphql/logging/DecayLogging.view.ts
@@ -1,6 +1,6 @@
import { AbstractLoggingView } from 'database'
-import { Decay } from '@graphql/model/Decay'
+import { Decay } from '../model/Decay'
import type { Decay as DecayInterface } from 'shared'
export class DecayLoggingView extends AbstractLoggingView {
diff --git a/core/src/graphql/logic/interpretEncryptedTransferArgs.ts b/core/src/graphql/logic/interpretEncryptedTransferArgs.ts
index 0d522bff7..301f6da16 100644
--- a/core/src/graphql/logic/interpretEncryptedTransferArgs.ts
+++ b/core/src/graphql/logic/interpretEncryptedTransferArgs.ts
@@ -6,10 +6,10 @@ import { CommunityLoggingView, getHomeCommunity } from 'database'
import { verifyAndDecrypt } from 'shared'
import { LOG4JS_BASE_CATEGORY_NAME } from '../../config/const'
-const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.resolver.util.interpretEncryptedTransferArgs`)
+const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.logic.interpretEncryptedTransferArgs`)
export const interpretEncryptedTransferArgs = async (args: EncryptedTransferArgs): Promise => {
- const methodLogger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.resolver.util.interpretEncryptedTransferArgs-method`)
+ const methodLogger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.logic.interpretEncryptedTransferArgs-method`)
methodLogger.addContext('handshakeID', args.handshakeID)
methodLogger.debug('interpretEncryptedTransferArgs()... args:', args)
// first find with args.publicKey the community 'requestingCom', which starts the request
diff --git a/core/src/graphql/logic/processXComSendCoins.ts b/core/src/graphql/logic/processXComSendCoins.ts
index 5b93a3d2b..19c75898f 100644
--- a/core/src/graphql/logic/processXComSendCoins.ts
+++ b/core/src/graphql/logic/processXComSendCoins.ts
@@ -13,21 +13,21 @@ import {
} from 'database'
import { Decimal } from 'decimal.js-light'
-import { CONFIG as CONFIG_CORE } from '@/config'
-import { LOG4JS_BASE_CATEGORY_NAME } from '@config/const'
+import { CONFIG as CONFIG_CORE } from '../../config'
+import { LOG4JS_BASE_CATEGORY_NAME } from '../../config/const'
-import { SendCoinsClient as V1_0_SendCoinsClient } from '@federation/client/1_0/SendCoinsClient'
-import { SendCoinsResult } from '@federation/client/1_0/model/SendCoinsResult'
-import { SendCoinsClientFactory } from '@federation/client/SendCoinsClientFactory'
-import { TransactionTypeId } from '@graphql/enum/TransactionTypeId'
+import { SendCoinsClient as V1_0_SendCoinsClient } from '../../federation/client/1_0/SendCoinsClient'
+import { SendCoinsResult } from '../../federation/client/1_0/model/SendCoinsResult'
+import { SendCoinsClientFactory } from '../../federation/client/SendCoinsClientFactory'
+import { TransactionTypeId } from '../../graphql/enum/TransactionTypeId'
import { encryptAndSign, PendingTransactionState, SendCoinsJwtPayloadType, SendCoinsResponseJwtPayloadType, verifyAndDecrypt } from 'shared'
// import { LogError } from '@server/LogError'
-import { calculateSenderBalance } from '@util/calculateSenderBalance'
-import { fullName } from '@util/utilities'
+import { calculateSenderBalance } from '../../util/calculateSenderBalance'
+import { fullName } from '../../util/utilities'
import { getLogger } from 'log4js'
-import { SendCoinsResultLoggingView } from '@federation/client/1_0/logging/SendCoinsResultLogging.view'
-import { EncryptedTransferArgs } from '@graphql/model/EncryptedTransferArgs'
+import { SendCoinsResultLoggingView } from '../../federation/client/1_0/logging/SendCoinsResultLogging.view'
+import { EncryptedTransferArgs } from '../../graphql/model/EncryptedTransferArgs'
import { randombytes_random } from 'sodium-native'
import { settlePendingSenderTransaction } from './settlePendingSenderTransaction'
import { storeForeignUser } from './storeForeignUser'
diff --git a/core/src/graphql/logic/settlePendingSenderTransaction.ts b/core/src/graphql/logic/settlePendingSenderTransaction.ts
index 8abd511c1..87ab8116c 100644
--- a/core/src/graphql/logic/settlePendingSenderTransaction.ts
+++ b/core/src/graphql/logic/settlePendingSenderTransaction.ts
@@ -10,7 +10,7 @@ import {
} from 'database'
import { Decimal } from 'decimal.js-light'
-import { LOG4JS_BASE_CATEGORY_NAME } from '@/config/const'
+import { LOG4JS_BASE_CATEGORY_NAME } from '../../config/const'
import { PendingTransactionState } from 'shared'
// import { LogError } from '@/server/LogError'
import { calculateSenderBalance } from 'core'
diff --git a/core/src/graphql/logic/storeForeignUser.ts b/core/src/graphql/logic/storeForeignUser.ts
index 402a9a835..1e6b8153f 100644
--- a/core/src/graphql/logic/storeForeignUser.ts
+++ b/core/src/graphql/logic/storeForeignUser.ts
@@ -1,7 +1,7 @@
import { Community as DbCommunity, User as DbUser, findForeignUserByUuids } from 'database'
-import { SendCoinsResult } from '@federation/client/1_0/model/SendCoinsResult'
-import { LOG4JS_BASE_CATEGORY_NAME } from '@/config/const'
+import { SendCoinsResult } from '../../federation/client/1_0/model/SendCoinsResult'
+import { LOG4JS_BASE_CATEGORY_NAME } from '../../config/const'
import { getLogger } from 'log4js'
const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.logic.storeForeignUser`)
diff --git a/core/src/util/calculateSenderBalance.ts b/core/src/util/calculateSenderBalance.ts
index ce7609895..7fe5ae19f 100644
--- a/core/src/util/calculateSenderBalance.ts
+++ b/core/src/util/calculateSenderBalance.ts
@@ -1,6 +1,6 @@
import { Decimal } from 'decimal.js-light'
-import { Decay } from '@graphql/model/Decay'
+import { Decay } from '../graphql/model/Decay'
import { getLastTransaction } from 'database'
diff --git a/core/tsconfig.json b/core/tsconfig.json
index 660381127..c30aab30d 100644
--- a/core/tsconfig.json
+++ b/core/tsconfig.json
@@ -51,7 +51,7 @@
"@federation/*": ["src/federation/*"],
"@graphql/*": ["src/graphql/*"],
"@util/*": ["src/util/*"],
- "@validation/*": ["src/validation/*"],
+ "@validation/*": ["src/validation/*"]
},
// "rootDirs": [".", "../database"], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */