diff --git a/services/apps/integration_data_worker/package-lock.json b/services/apps/integration_data_worker/package-lock.json index eb069a11ee..bf939613f4 100644 --- a/services/apps/integration_data_worker/package-lock.json +++ b/services/apps/integration_data_worker/package-lock.json @@ -19,6 +19,7 @@ "@types/node": "^18.16.3", "config": "^3.3.9", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", "typescript": "^5.0.4" }, "devDependencies": { @@ -1739,6 +1740,14 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2220,6 +2229,14 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2328,6 +2345,19 @@ } } }, + "node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", @@ -3743,6 +3773,11 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4075,6 +4110,11 @@ "ansi-regex": "^5.0.1" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -4140,6 +4180,16 @@ "yn": "3.1.1" } }, + "tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "requires": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", diff --git a/services/apps/integration_data_worker/package.json b/services/apps/integration_data_worker/package.json index 636a4da296..3f3828dad7 100644 --- a/services/apps/integration_data_worker/package.json +++ b/services/apps/integration_data_worker/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "scripts": { - "start": "node -r ts-node/register src/main.ts --transpile-only", - "start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && SERVICE=integration-data-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9232 -r ts-node/register src/main.ts --transpile-only", - "start:debug": "SERVICE=integration-data-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9232 -r ts-node/register src/main.ts --transpile-only", + "start": "node -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", + "start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && SERVICE=integration-data-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9232 -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", + "start:debug": "SERVICE=integration-data-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9232 -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", "start:watch:local": "nodemon --watch src --ext ts --exec npm run start:debug:local", "start:watch": "nodemon --watch src --ext ts --exec npm run start:debug", "dev:local": "concurrently \"npm run start:watch:local\" \"../../scripts/watch_libs.sh --service integration_data_worker\"", @@ -27,6 +27,7 @@ "@types/node": "^18.16.3", "config": "^3.3.9", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", "typescript": "^5.0.4" }, "devDependencies": { diff --git a/services/apps/integration_data_worker/src/config/index.ts b/services/apps/integration_data_worker/src/conf/index.ts similarity index 97% rename from services/apps/integration_data_worker/src/config/index.ts rename to services/apps/integration_data_worker/src/conf/index.ts index 9e5fa33e9d..85fdd3926c 100644 --- a/services/apps/integration_data_worker/src/config/index.ts +++ b/services/apps/integration_data_worker/src/conf/index.ts @@ -1,7 +1,7 @@ import { IDatabaseConfig } from '@crowd/database' import { IRedisConfiguration } from '@crowd/redis' import { ISqsClientConfig } from '@crowd/sqs' -import config = require('config') +import config from 'config' export interface IWorkerSettings { maxDataRetries: number diff --git a/services/apps/integration_data_worker/src/main.ts b/services/apps/integration_data_worker/src/main.ts index a83d408a97..9ad4fb1637 100644 --- a/services/apps/integration_data_worker/src/main.ts +++ b/services/apps/integration_data_worker/src/main.ts @@ -1,5 +1,5 @@ import { getServiceLogger } from '@crowd/logging' -import { DB_CONFIG, REDIS_CONFIG, SQS_CONFIG } from './config' +import { DB_CONFIG, REDIS_CONFIG, SQS_CONFIG } from './conf' import { getRedisClient } from '@crowd/redis' import { getDbConnection } from '@crowd/database' import { DataSinkWorkerEmitter, IntegrationStreamWorkerEmitter, getSqsClient } from '@crowd/sqs' diff --git a/services/apps/integration_data_worker/src/service/integrationDataService.ts b/services/apps/integration_data_worker/src/service/integrationDataService.ts index 5e876a76fd..a90bf6bc7f 100644 --- a/services/apps/integration_data_worker/src/service/integrationDataService.ts +++ b/services/apps/integration_data_worker/src/service/integrationDataService.ts @@ -5,7 +5,7 @@ import IntegrationDataRepository from '../repo/integrationData.repo' import { IActivityData, IntegrationResultType } from '@crowd/types' import { addSeconds, singleOrDefault } from '@crowd/common' import { INTEGRATION_SERVICES, IProcessDataContext } from '@crowd/integrations' -import { WORKER_SETTINGS, PLATFORM_CONFIG } from '../config' +import { WORKER_SETTINGS, PLATFORM_CONFIG } from '@/conf' import { DataSinkWorkerEmitter, IntegrationStreamWorkerEmitter } from '@crowd/sqs' export default class IntegrationDataService extends LoggerBase { diff --git a/services/apps/integration_data_worker/tsconfig.json b/services/apps/integration_data_worker/tsconfig.json index 5881448379..6be3e6e865 100644 --- a/services/apps/integration_data_worker/tsconfig.json +++ b/services/apps/integration_data_worker/tsconfig.json @@ -9,9 +9,11 @@ "sourceMap": true, "moduleResolution": "node16", "experimentalDecorators": true, - "baseUrl": ".", + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../../libs/*/dist"] + "@crowd/*": ["../../../libs/*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/apps/integration_run_worker/package-lock.json b/services/apps/integration_run_worker/package-lock.json index 16d5fa681f..55e8a1429d 100644 --- a/services/apps/integration_run_worker/package-lock.json +++ b/services/apps/integration_run_worker/package-lock.json @@ -19,6 +19,7 @@ "@types/node": "^18.16.3", "config": "^3.3.9", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", "typescript": "^5.0.4", "uuid": "^9.0.0" }, @@ -1743,6 +1744,14 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2224,6 +2233,14 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2329,6 +2346,19 @@ } } }, + "node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", @@ -3752,6 +3782,11 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4084,6 +4119,11 @@ "ansi-regex": "^5.0.1" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -4149,6 +4189,16 @@ "yn": "3.1.1" } }, + "tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "requires": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", diff --git a/services/apps/integration_run_worker/package.json b/services/apps/integration_run_worker/package.json index eb7ae041d2..aacc974393 100644 --- a/services/apps/integration_run_worker/package.json +++ b/services/apps/integration_run_worker/package.json @@ -3,10 +3,10 @@ "version": "1.0.0", "private": true, "scripts": { - "start": "node -r ts-node/register src/main.ts --transpile-only", - "start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && SERVICE=integration-run-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9230 -r ts-node/register src/main.ts --transpile-only", - "start:debug": "SERVICE=integration-run-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9230 -r ts-node/register src/main.ts --transpile-only", - "start:watc:local": "nodemon --watch src --ext ts --exec npm run start:debug:local", + "start": "node -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", + "start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && SERVICE=integration-run-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9230 -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", + "start:debug": "SERVICE=integration-run-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9230 -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", + "start:watch:local": "nodemon --watch src --ext ts --exec npm run start:debug:local", "start:watch": "nodemon --watch src --ext ts --exec npm run start:debug", "dev:local": "concurrently \"npm run start:watch:local\" \"../../scripts/watch_libs.sh --service integration_run_worker\"", "dev": "concurrently \"npm run start:watch\" \"../../scripts/watch_libs.sh --service integration_run_worker\"", @@ -27,6 +27,7 @@ "@types/node": "^18.16.3", "config": "^3.3.9", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", "typescript": "^5.0.4", "uuid": "^9.0.0" }, diff --git a/services/apps/integration_run_worker/src/config/index.ts b/services/apps/integration_run_worker/src/conf/index.ts similarity index 97% rename from services/apps/integration_run_worker/src/config/index.ts rename to services/apps/integration_run_worker/src/conf/index.ts index 0017da33e1..04ca0208f8 100644 --- a/services/apps/integration_run_worker/src/config/index.ts +++ b/services/apps/integration_run_worker/src/conf/index.ts @@ -1,7 +1,7 @@ import { IDatabaseConfig } from '@crowd/database' import { IRedisConfiguration } from '@crowd/redis' import { ISqsClientConfig } from '@crowd/sqs' -import config = require('config') +import config from 'config' export interface INangoConfig { url: string diff --git a/services/apps/integration_run_worker/src/main.ts b/services/apps/integration_run_worker/src/main.ts index be83335b57..293d740727 100644 --- a/services/apps/integration_run_worker/src/main.ts +++ b/services/apps/integration_run_worker/src/main.ts @@ -1,7 +1,7 @@ import { getDbConnection } from '@crowd/database' import { getServiceLogger } from '@crowd/logging' import { IntegrationStreamWorkerEmitter, getSqsClient } from '@crowd/sqs' -import { DB_CONFIG, REDIS_CONFIG, SQS_CONFIG } from './config' +import { DB_CONFIG, REDIS_CONFIG, SQS_CONFIG } from './conf' import { WorkerQueueReceiver } from './queue' import { ApiPubSubEmitter, getRedisClient } from '@crowd/redis' diff --git a/services/apps/integration_run_worker/src/repo/integrationRun.data.ts b/services/apps/integration_run_worker/src/repo/integrationRun.data.ts index 118d701a94..b388c35994 100644 --- a/services/apps/integration_run_worker/src/repo/integrationRun.data.ts +++ b/services/apps/integration_run_worker/src/repo/integrationRun.data.ts @@ -1,4 +1,4 @@ -import { IntegrationState, IntegrationRunState } from '@crowd/types' +import { IntegrationRunState, IntegrationState } from '@crowd/types' export interface IGenerateStreamsData { onboarding: boolean diff --git a/services/apps/integration_run_worker/src/repo/integrationRun.repo.ts b/services/apps/integration_run_worker/src/repo/integrationRun.repo.ts index 61582e7f4e..c73cc00d66 100644 --- a/services/apps/integration_run_worker/src/repo/integrationRun.repo.ts +++ b/services/apps/integration_run_worker/src/repo/integrationRun.repo.ts @@ -2,7 +2,7 @@ import { DbStore, RepositoryBase } from '@crowd/database' import { Logger } from '@crowd/logging' import { IGenerateStreamsData } from './integrationRun.data' import { IntegrationRunState, IntegrationStreamState } from '@crowd/types' -import { WORKER_CONFIG } from '../config' +import { WORKER_CONFIG } from '../conf' export default class IntegrationRunRepository extends RepositoryBase { constructor(dbStore: DbStore, parentLog: Logger) { diff --git a/services/apps/integration_run_worker/src/service/integrationRunService.ts b/services/apps/integration_run_worker/src/service/integrationRunService.ts index aa99947000..d70ab22271 100644 --- a/services/apps/integration_run_worker/src/service/integrationRunService.ts +++ b/services/apps/integration_run_worker/src/service/integrationRunService.ts @@ -5,7 +5,7 @@ import { Logger, LoggerBase, getChildLogger } from '@crowd/logging' import { ApiPubSubEmitter, RedisCache, RedisClient } from '@crowd/redis' import { IntegrationStreamWorkerEmitter } from '@crowd/sqs' import { IntegrationRunState, IntegrationStreamState } from '@crowd/types' -import { NANGO_CONFIG, PLATFORM_CONFIG } from '../config' +import { NANGO_CONFIG, PLATFORM_CONFIG } from '../conf' import IntegrationRunRepository from '../repo/integrationRun.repo' import MemberAttributeSettingsRepository from '../repo/memberAttributeSettings.repo' import SampleDataRepository from '../repo/sampleData.repo' diff --git a/services/apps/integration_run_worker/tsconfig.json b/services/apps/integration_run_worker/tsconfig.json index a7778fd7b5..a5c9e30e92 100644 --- a/services/apps/integration_run_worker/tsconfig.json +++ b/services/apps/integration_run_worker/tsconfig.json @@ -9,9 +9,11 @@ "moduleResolution": "node16", "sourceMap": true, "experimentalDecorators": true, - "baseUrl": ".", + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../../libs/*/dist"] + "@crowd/*": ["../../../libs/*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/apps/integration_stream_worker/package-lock.json b/services/apps/integration_stream_worker/package-lock.json index 869665d283..e1b93d0826 100644 --- a/services/apps/integration_stream_worker/package-lock.json +++ b/services/apps/integration_stream_worker/package-lock.json @@ -19,6 +19,7 @@ "@types/node": "^18.16.3", "config": "^3.3.9", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", "typescript": "^5.0.4", "uuid": "^9.0.0" }, @@ -1740,6 +1741,14 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2221,6 +2230,14 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2329,6 +2346,19 @@ } } }, + "node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", @@ -3752,6 +3782,11 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4084,6 +4119,11 @@ "ansi-regex": "^5.0.1" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -4149,6 +4189,16 @@ "yn": "3.1.1" } }, + "tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "requires": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", diff --git a/services/apps/integration_stream_worker/package.json b/services/apps/integration_stream_worker/package.json index 5910d4c450..36ae6ac447 100644 --- a/services/apps/integration_stream_worker/package.json +++ b/services/apps/integration_stream_worker/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "scripts": { - "start": "node -r ts-node/register src/main.ts --transpile-only", - "start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && SERVICE=integration-stream-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9231 -r ts-node/register src/main.ts --transpile-only", - "start:debug": "SERVICE=integration-stream-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9231 -r ts-node/register src/main.ts --transpile-only", + "start": "node -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", + "start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && SERVICE=integration-stream-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9231 -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", + "start:debug": "SERVICE=integration-stream-worker LOG_LEVEL=trace node --inspect=0.0.0.0:9231 -r tsconfig-paths/register -r ts-node/register src/main.ts --transpile-only", "start:watch:local": "nodemon --watch src --ext ts --exec npm run start:debug:local", "start:watch": "nodemon --watch src --ext ts --exec npm run start:debug", "dev:local": "concurrently \"npm run start:watch:local\" \"../../scripts/watch_libs.sh --service integration_stream_worker\"", @@ -27,6 +27,7 @@ "@types/node": "^18.16.3", "config": "^3.3.9", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", "typescript": "^5.0.4", "uuid": "^9.0.0" }, diff --git a/services/apps/integration_stream_worker/src/config/index.ts b/services/apps/integration_stream_worker/src/conf/index.ts similarity index 97% rename from services/apps/integration_stream_worker/src/config/index.ts rename to services/apps/integration_stream_worker/src/conf/index.ts index 96a57a3abf..b08f492021 100644 --- a/services/apps/integration_stream_worker/src/config/index.ts +++ b/services/apps/integration_stream_worker/src/conf/index.ts @@ -1,7 +1,7 @@ import { IDatabaseConfig } from '@crowd/database' import { IRedisConfiguration } from '@crowd/redis' import { ISqsClientConfig } from '@crowd/sqs' -import config = require('config') +import config from 'config' export interface IWorkerConfig { maxStreamRetries: number diff --git a/services/apps/integration_stream_worker/src/main.ts b/services/apps/integration_stream_worker/src/main.ts index 91d912c002..3e1641a8fd 100644 --- a/services/apps/integration_stream_worker/src/main.ts +++ b/services/apps/integration_stream_worker/src/main.ts @@ -1,5 +1,5 @@ import { getServiceLogger } from '@crowd/logging' -import { DB_CONFIG, REDIS_CONFIG, SQS_CONFIG } from './config' +import { DB_CONFIG, REDIS_CONFIG, SQS_CONFIG } from './conf' import { getRedisClient } from '@crowd/redis' import { getDbConnection } from '@crowd/database' import { diff --git a/services/apps/integration_stream_worker/src/service/integrationStreamService.ts b/services/apps/integration_stream_worker/src/service/integrationStreamService.ts index b0c8fbceac..19415d606a 100644 --- a/services/apps/integration_stream_worker/src/service/integrationStreamService.ts +++ b/services/apps/integration_stream_worker/src/service/integrationStreamService.ts @@ -5,7 +5,7 @@ import { RedisCache, RedisClient } from '@crowd/redis' import IntegrationStreamRepository from '../repo/integrationStream.repo' import { IntegrationStreamType, RateLimitError } from '@crowd/types' import { INTEGRATION_SERVICES, IProcessStreamContext } from '@crowd/integrations' -import { NANGO_CONFIG, WORKER_SETTINGS, PLATFORM_CONFIG } from '../config' +import { NANGO_CONFIG, WORKER_SETTINGS, PLATFORM_CONFIG } from '../conf' import { IntegrationDataWorkerEmitter, IntegrationRunWorkerEmitter, diff --git a/services/apps/integration_stream_worker/tsconfig.json b/services/apps/integration_stream_worker/tsconfig.json index 5881448379..6be3e6e865 100644 --- a/services/apps/integration_stream_worker/tsconfig.json +++ b/services/apps/integration_stream_worker/tsconfig.json @@ -9,9 +9,11 @@ "sourceMap": true, "moduleResolution": "node16", "experimentalDecorators": true, - "baseUrl": ".", + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../../libs/*/dist"] + "@crowd/*": ["../../../libs/*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/common/src/index.ts b/services/libs/common/src/index.ts index 4c8b24c16a..d588008662 100644 --- a/services/libs/common/src/index.ts +++ b/services/libs/common/src/index.ts @@ -3,6 +3,6 @@ export * from './timing' export * from './utils' export * from './array' export * from './object' -export * from './uuid' +export * from './uuidUtils' export * from './validations' export * from './strings' diff --git a/services/libs/common/src/uuid.ts b/services/libs/common/src/uuidUtils.ts similarity index 100% rename from services/libs/common/src/uuid.ts rename to services/libs/common/src/uuidUtils.ts diff --git a/services/libs/common/tsconfig.json b/services/libs/common/tsconfig.json index 04ee3d3b39..5df7eff644 100644 --- a/services/libs/common/tsconfig.json +++ b/services/libs/common/tsconfig.json @@ -9,8 +9,11 @@ "sourceMap": true, "moduleResolution": "node", "experimentalDecorators": true, + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/conversations/tsconfig.json b/services/libs/conversations/tsconfig.json index 1e87953eff..da79129db6 100644 --- a/services/libs/conversations/tsconfig.json +++ b/services/libs/conversations/tsconfig.json @@ -9,9 +9,11 @@ "moduleResolution": "node", "sourceMap": true, "experimentalDecorators": true, - "baseUrl": ".", + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/database/tsconfig.json b/services/libs/database/tsconfig.json index ff184be234..da79129db6 100644 --- a/services/libs/database/tsconfig.json +++ b/services/libs/database/tsconfig.json @@ -10,9 +10,10 @@ "sourceMap": true, "experimentalDecorators": true, "esModuleInterop": true, - "baseUrl": ".", + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/integrations/tsconfig.json b/services/libs/integrations/tsconfig.json index ff184be234..da79129db6 100644 --- a/services/libs/integrations/tsconfig.json +++ b/services/libs/integrations/tsconfig.json @@ -10,9 +10,10 @@ "sourceMap": true, "experimentalDecorators": true, "esModuleInterop": true, - "baseUrl": ".", + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/logging/tsconfig.json b/services/libs/logging/tsconfig.json index ff184be234..da79129db6 100644 --- a/services/libs/logging/tsconfig.json +++ b/services/libs/logging/tsconfig.json @@ -10,9 +10,10 @@ "sourceMap": true, "experimentalDecorators": true, "esModuleInterop": true, - "baseUrl": ".", + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/redis/tsconfig.json b/services/libs/redis/tsconfig.json index 04ee3d3b39..5df7eff644 100644 --- a/services/libs/redis/tsconfig.json +++ b/services/libs/redis/tsconfig.json @@ -9,8 +9,11 @@ "sourceMap": true, "moduleResolution": "node", "experimentalDecorators": true, + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/sentiment/tsconfig.json b/services/libs/sentiment/tsconfig.json index 1e87953eff..da79129db6 100644 --- a/services/libs/sentiment/tsconfig.json +++ b/services/libs/sentiment/tsconfig.json @@ -9,9 +9,11 @@ "moduleResolution": "node", "sourceMap": true, "experimentalDecorators": true, - "baseUrl": ".", + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/sqs/tsconfig.json b/services/libs/sqs/tsconfig.json index 1e87953eff..da79129db6 100644 --- a/services/libs/sqs/tsconfig.json +++ b/services/libs/sqs/tsconfig.json @@ -9,9 +9,11 @@ "moduleResolution": "node", "sourceMap": true, "experimentalDecorators": true, - "baseUrl": ".", + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"] diff --git a/services/libs/types/tsconfig.json b/services/libs/types/tsconfig.json index 1e87953eff..da79129db6 100644 --- a/services/libs/types/tsconfig.json +++ b/services/libs/types/tsconfig.json @@ -9,9 +9,11 @@ "moduleResolution": "node", "sourceMap": true, "experimentalDecorators": true, - "baseUrl": ".", + "esModuleInterop": true, + "baseUrl": "./src", "paths": { - "@crowd/*": ["../*/dist"] + "@crowd/*": ["../../*/dist"], + "@/*": ["./*"] } }, "include": ["src/**/*"]