@squidcloud/local-backend 1.0.96 → 1.0.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/src/ai-assistant.types.d.ts +24 -0
- package/dist/common/src/ai-assistant.types.js.map +1 -1
- package/dist/common/src/application.types.js +1 -1
- package/dist/common/src/application.types.js.map +1 -1
- package/dist/common/src/backend-run.types.js +1 -1
- package/dist/common/src/backend-run.types.js.map +1 -1
- package/dist/common/src/distributed-lock.context.d.ts +1 -2
- package/dist/common/src/distributed-lock.context.js +1 -2
- package/dist/common/src/distributed-lock.context.js.map +1 -1
- package/dist/common/src/http-status.enum.js +1 -1
- package/dist/common/src/http-status.enum.js.map +1 -1
- package/dist/common/src/integrations/ai_assistant.types.d.ts +1 -0
- package/dist/common/src/integrations/auth.types.d.ts +1 -1
- package/dist/common/src/integrations/database.types.d.ts +1 -1
- package/dist/common/src/integrations/index.js +3 -3
- package/dist/common/src/integrations/index.js.map +1 -1
- package/dist/common/src/logger.types.js +1 -1
- package/dist/common/src/logger.types.js.map +1 -1
- package/dist/common/src/socket.schemas.js +1 -2
- package/dist/common/src/socket.schemas.js.map +1 -1
- package/dist/common/src/socket.types.d.ts +0 -1
- package/dist/common/src/socket.types.js +1 -1
- package/dist/common/src/socket.types.js.map +1 -1
- package/dist/internal-common/src/utils/logger-utils.js +11 -14
- package/dist/internal-common/src/utils/logger-utils.js.map +1 -1
- package/dist/local-backend/package.json +2 -5
- package/dist/local-backend/src/local-backend-socket.service.js +3 -3
- package/dist/local-backend/src/local-backend-socket.service.js.map +1 -1
- package/dist/local-backend/src/local-backend.controller.js +2 -2
- package/dist/local-backend/src/local-backend.controller.js.map +1 -1
- package/dist/local-backend/src/local-backend.module.js +5 -5
- package/dist/local-backend/src/local-backend.module.js.map +1 -1
- package/dist/local-backend/src/local-backend.service.js +3 -3
- package/dist/local-backend/src/local-backend.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -5
- package/dist/internal-common/src/async-queue.d.ts +0 -4
- package/dist/internal-common/src/async-queue.js +0 -18
- package/dist/internal-common/src/async-queue.js.map +0 -1
- package/dist/internal-common/src/dao.types.d.ts +0 -50
- package/dist/internal-common/src/dao.types.js +0 -3
- package/dist/internal-common/src/dao.types.js.map +0 -1
- package/dist/internal-common/src/environment/environment.types.d.ts +0 -74
- package/dist/internal-common/src/environment/environment.types.js +0 -3
- package/dist/internal-common/src/environment/environment.types.js.map +0 -1
- package/dist/internal-common/src/environment/index.d.ts +0 -6
- package/dist/internal-common/src/environment/index.js +0 -28
- package/dist/internal-common/src/environment/index.js.map +0 -1
- package/dist/internal-common/src/environment/local.environment.d.ts +0 -2
- package/dist/internal-common/src/environment/local.environment.js +0 -63
- package/dist/internal-common/src/environment/local.environment.js.map +0 -1
- package/dist/internal-common/src/filters/custom-exception.filter.d.ts +0 -6
- package/dist/internal-common/src/filters/custom-exception.filter.js +0 -45
- package/dist/internal-common/src/filters/custom-exception.filter.js.map +0 -1
- package/dist/internal-common/src/index.d.ts +0 -15
- package/dist/internal-common/src/index.js +0 -34
- package/dist/internal-common/src/index.js.map +0 -1
- package/dist/internal-common/src/interceptors/body.interceptor.d.ts +0 -5
- package/dist/internal-common/src/interceptors/body.interceptor.js +0 -25
- package/dist/internal-common/src/interceptors/body.interceptor.js.map +0 -1
- package/dist/internal-common/src/kafka/kafka.manager.d.ts +0 -22
- package/dist/internal-common/src/kafka/kafka.manager.js +0 -125
- package/dist/internal-common/src/kafka/kafka.manager.js.map +0 -1
- package/dist/internal-common/src/kafka/kafka.types.d.ts +0 -17
- package/dist/internal-common/src/kafka/kafka.types.js +0 -3
- package/dist/internal-common/src/kafka/kafka.types.js.map +0 -1
- package/dist/internal-common/src/kafka-observability-publisher.d.ts +0 -11
- package/dist/internal-common/src/kafka-observability-publisher.js +0 -21
- package/dist/internal-common/src/kafka-observability-publisher.js.map +0 -1
- package/dist/internal-common/src/observability-publisher.d.ts +0 -9
- package/dist/internal-common/src/observability-publisher.js +0 -61
- package/dist/internal-common/src/observability-publisher.js.map +0 -1
- package/dist/internal-common/src/observability.types.d.ts +0 -18
- package/dist/internal-common/src/observability.types.js +0 -3
- package/dist/internal-common/src/observability.types.js.map +0 -1
- package/dist/internal-common/src/shutdown.manager.d.ts +0 -20
- package/dist/internal-common/src/shutdown.manager.js +0 -76
- package/dist/internal-common/src/shutdown.manager.js.map +0 -1
- package/dist/internal-common/src/utils/index.d.ts +0 -2
- package/dist/internal-common/src/utils/index.js +0 -19
- package/dist/internal-common/src/utils/index.js.map +0 -1
- package/dist/internal-common/src/utils/time-utils.d.ts +0 -1
- package/dist/internal-common/src/utils/time-utils.js +0 -8
- package/dist/internal-common/src/utils/time-utils.js.map +0 -1
- package/dist/internal-common/src/utils.d.ts +0 -5
- package/dist/internal-common/src/utils.js +0 -30
- package/dist/internal-common/src/utils.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/local-backend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.98",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/local-backend/src/index.js",
|
|
6
6
|
"types": "dist/local-backend/src/index.d.ts",
|
|
@@ -48,13 +48,10 @@
|
|
|
48
48
|
"@types/express": "^4.17.13",
|
|
49
49
|
"@types/node": "18.11.18",
|
|
50
50
|
"@types/supertest": "^2.0.11",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
52
|
-
"@typescript-eslint/parser": "^5.0.0",
|
|
53
51
|
"source-map-support": "^0.5.20",
|
|
54
52
|
"supertest": "^6.1.3",
|
|
55
53
|
"ts-loader": "^9.2.3",
|
|
56
54
|
"ts-node": "^10.0.0",
|
|
57
|
-
"tsconfig-paths": "4.1.1"
|
|
58
|
-
"typescript": "^5.2.2"
|
|
55
|
+
"tsconfig-paths": "4.1.1"
|
|
59
56
|
}
|
|
60
57
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsyncQueue = void 0;
|
|
4
|
-
class AsyncQueue {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.promise = Promise.resolve();
|
|
7
|
-
}
|
|
8
|
-
enqueue(fn) {
|
|
9
|
-
let resultResolve;
|
|
10
|
-
const result = new Promise(resolve => {
|
|
11
|
-
resultResolve = resolve;
|
|
12
|
-
});
|
|
13
|
-
this.promise = this.promise.then(() => fn().then(resultResolve));
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.AsyncQueue = AsyncQueue;
|
|
18
|
-
//# sourceMappingURL=async-queue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-queue.js","sourceRoot":"","sources":["../../../../internal-common/src/async-queue.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAU;IAAvB;QACE,YAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAY9B,CAAC;IAVC,OAAO,CAAC,EAAoC;QAC1C,IAAI,aAAkB,CAAC;QAEvB,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACnC,aAAa,GAAG,OAAO,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACjE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAbD,gCAaC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { AiAssistantContextMetadata, AiAssistantProfileMetadata, AppId, ApplicationBundleData, ClientId, CodeUrl, IntegrationConfig, IntegrationId, IntegrationSchema, MessageToClient, OpenIdProvider, SchedulerId } from '@squidcloud/common';
|
|
2
|
-
export interface ApplicationBo {
|
|
3
|
-
appId: AppId;
|
|
4
|
-
organizationId: string;
|
|
5
|
-
codeUrl?: CodeUrl;
|
|
6
|
-
allowedHosts: string[];
|
|
7
|
-
createdAt: Date;
|
|
8
|
-
updatedAt: Date;
|
|
9
|
-
openIdProvider?: OpenIdProvider;
|
|
10
|
-
integrations: Record<IntegrationId, IntegrationConfig>;
|
|
11
|
-
bundleData?: ApplicationBundleData;
|
|
12
|
-
}
|
|
13
|
-
export interface ScheduledJobBo {
|
|
14
|
-
appId: AppId;
|
|
15
|
-
schedulerId: SchedulerId;
|
|
16
|
-
nextRunTime: number;
|
|
17
|
-
}
|
|
18
|
-
export interface MessageToClientBo {
|
|
19
|
-
message: MessageToClient;
|
|
20
|
-
appId: AppId;
|
|
21
|
-
clientId: ClientId;
|
|
22
|
-
createdAt: Date;
|
|
23
|
-
}
|
|
24
|
-
export interface SchemaBoEnvelope {
|
|
25
|
-
schema?: SchemaBo;
|
|
26
|
-
}
|
|
27
|
-
export interface SchemaBo {
|
|
28
|
-
appId: AppId;
|
|
29
|
-
integrationId: IntegrationId;
|
|
30
|
-
schema: IntegrationSchema;
|
|
31
|
-
createdAt: Date;
|
|
32
|
-
updatedAt: Date;
|
|
33
|
-
}
|
|
34
|
-
export interface AiProfileBo {
|
|
35
|
-
appId: AppId;
|
|
36
|
-
integrationId: IntegrationId;
|
|
37
|
-
id: string;
|
|
38
|
-
profile: AiAssistantProfileMetadata;
|
|
39
|
-
createdAt: Date;
|
|
40
|
-
updatedAt: Date;
|
|
41
|
-
}
|
|
42
|
-
export interface AiContextBo {
|
|
43
|
-
appId: AppId;
|
|
44
|
-
integrationId: IntegrationId;
|
|
45
|
-
profileId: string;
|
|
46
|
-
id: string;
|
|
47
|
-
context: AiAssistantContextMetadata;
|
|
48
|
-
createdAt: Date;
|
|
49
|
-
updatedAt: Date;
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dao.types.js","sourceRoot":"","sources":["../../../../internal-common/src/dao.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { DatadogRegion, SupportedSquidRegion } from '@squidcloud/common';
|
|
2
|
-
type VaultConfig = {
|
|
3
|
-
endpoint: string;
|
|
4
|
-
token: string;
|
|
5
|
-
} | {
|
|
6
|
-
endpoint: string;
|
|
7
|
-
role_id: string;
|
|
8
|
-
secret_id: string;
|
|
9
|
-
};
|
|
10
|
-
type KafkaConfig = {
|
|
11
|
-
clusterUrls: string[];
|
|
12
|
-
consumerSessionTimeoutMs: number;
|
|
13
|
-
} | {
|
|
14
|
-
clusterUrls: string[];
|
|
15
|
-
consumerSessionTimeoutMs: number;
|
|
16
|
-
username: string;
|
|
17
|
-
password: string;
|
|
18
|
-
};
|
|
19
|
-
export interface EnvironmentVars {
|
|
20
|
-
region: string;
|
|
21
|
-
environment: string;
|
|
22
|
-
redisUrl: string;
|
|
23
|
-
stage: string;
|
|
24
|
-
dbConnectionLimit: number;
|
|
25
|
-
dbSslEnabled: boolean;
|
|
26
|
-
squidRegion: SupportedSquidRegion;
|
|
27
|
-
internalApiKey: string;
|
|
28
|
-
code: {
|
|
29
|
-
bucket: string;
|
|
30
|
-
awsEndpoint?: string;
|
|
31
|
-
};
|
|
32
|
-
kafka: KafkaConfig;
|
|
33
|
-
vault: VaultConfig;
|
|
34
|
-
zookeeper: {
|
|
35
|
-
host: string;
|
|
36
|
-
lockDirectory: string;
|
|
37
|
-
};
|
|
38
|
-
kafkaConnect: {
|
|
39
|
-
endpoint: string;
|
|
40
|
-
};
|
|
41
|
-
sharedMongo: {
|
|
42
|
-
connectionString: string;
|
|
43
|
-
database?: string;
|
|
44
|
-
user?: string;
|
|
45
|
-
};
|
|
46
|
-
datadog: {
|
|
47
|
-
datadogRegion: DatadogRegion;
|
|
48
|
-
agentUrl: string;
|
|
49
|
-
envName: string;
|
|
50
|
-
};
|
|
51
|
-
snowflake: {
|
|
52
|
-
account: string;
|
|
53
|
-
username: string;
|
|
54
|
-
password: string;
|
|
55
|
-
database: string;
|
|
56
|
-
schema: string;
|
|
57
|
-
warehouse: string;
|
|
58
|
-
role: string;
|
|
59
|
-
};
|
|
60
|
-
pinecone: {
|
|
61
|
-
environment: string;
|
|
62
|
-
indexName: string;
|
|
63
|
-
};
|
|
64
|
-
weaviate?: {
|
|
65
|
-
scheme: string;
|
|
66
|
-
host: string;
|
|
67
|
-
apiKey: string | undefined;
|
|
68
|
-
};
|
|
69
|
-
tenant: {
|
|
70
|
-
baseUrl?: string;
|
|
71
|
-
image?: string;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"environment.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/environment/environment.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { EnvironmentVars } from './environment.types';
|
|
2
|
-
export { EnvironmentVars } from './environment.types';
|
|
3
|
-
export type Stage = 'local' | 'prod' | 'dev';
|
|
4
|
-
export declare const STAGE: Stage;
|
|
5
|
-
export declare function getProcessEnv(key: string): string;
|
|
6
|
-
export declare function getEnv<K extends keyof EnvironmentVars>(key: K): EnvironmentVars[K];
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEnv = exports.getProcessEnv = exports.STAGE = void 0;
|
|
4
|
-
const local_environment_1 = require("./local.environment");
|
|
5
|
-
const assertic_1 = require("assertic");
|
|
6
|
-
exports.STAGE = (process.env['NODE_ENV'] || 'local');
|
|
7
|
-
let activeEnvironment;
|
|
8
|
-
function getProcessEnv(key) {
|
|
9
|
-
return (0, assertic_1.truthy)(process.env[key], `No ${key} environment variable`);
|
|
10
|
-
}
|
|
11
|
-
exports.getProcessEnv = getProcessEnv;
|
|
12
|
-
function getEnv(key) {
|
|
13
|
-
if (activeEnvironment === undefined) {
|
|
14
|
-
switch (exports.STAGE) {
|
|
15
|
-
case 'local':
|
|
16
|
-
case 'test':
|
|
17
|
-
activeEnvironment = local_environment_1.LocalEnvironment;
|
|
18
|
-
break;
|
|
19
|
-
case 'dev':
|
|
20
|
-
case 'prod':
|
|
21
|
-
activeEnvironment = JSON.parse((0, assertic_1.truthy)(process.env['SQUID_ENV'], 'No SQUID_ENV environment variable'));
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return (0, assertic_1.truthy)(activeEnvironment, 'No active environment')[key];
|
|
26
|
-
}
|
|
27
|
-
exports.getEnv = getEnv;
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../internal-common/src/environment/index.ts"],"names":[],"mappings":";;;AACA,2DAAuD;AACvD,uCAAkC;AAIrB,QAAA,KAAK,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAU,CAAC;AAGnE,IAAI,iBAA8C,CAAC;AAEnD,SAAgB,aAAa,CAAC,GAAW;IACvC,OAAO,IAAA,iBAAM,EAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,CAAC;AACpE,CAAC;AAFD,sCAEC;AAED,SAAgB,MAAM,CAAkC,GAAM;IAC5D,IAAI,iBAAiB,KAAK,SAAS,EAAE;QACnC,QAAQ,aAAK,EAAE;YACb,KAAK,OAAO,CAAC;YACb,KAAK,MAAe;gBAClB,iBAAiB,GAAG,oCAAgB,CAAC;gBACrC,MAAM;YACR,KAAK,KAAK,CAAC;YACX,KAAK,MAAM;gBACT,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAC5B,IAAA,iBAAM,EAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,mCAAmC,CAAC,CACnD,CAAC;gBACrB,MAAM;SACT;KACF;IACD,OAAO,IAAA,iBAAM,EAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC;AACjE,CAAC;AAhBD,wBAgBC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocalEnvironment = void 0;
|
|
4
|
-
exports.LocalEnvironment = {
|
|
5
|
-
region: 'us-east-1',
|
|
6
|
-
environment: 'local',
|
|
7
|
-
redisUrl: 'redis://127.0.0.1:6379',
|
|
8
|
-
dbConnectionLimit: 5,
|
|
9
|
-
stage: 'local',
|
|
10
|
-
dbSslEnabled: false,
|
|
11
|
-
squidRegion: 'local',
|
|
12
|
-
internalApiKey: 'localInternalApiKey',
|
|
13
|
-
tenant: {
|
|
14
|
-
baseUrl: 'http://127.0.0.1:3000',
|
|
15
|
-
},
|
|
16
|
-
code: {
|
|
17
|
-
bucket: 'squid-code-bucket',
|
|
18
|
-
awsEndpoint: 'http://localhost.localstack.cloud:4566',
|
|
19
|
-
},
|
|
20
|
-
kafka: {
|
|
21
|
-
clusterUrls: ['kafka.local.squid.cloud:9092'],
|
|
22
|
-
consumerSessionTimeoutMs: 10000,
|
|
23
|
-
},
|
|
24
|
-
kafkaConnect: {
|
|
25
|
-
endpoint: 'http://127.0.0.1:8083',
|
|
26
|
-
},
|
|
27
|
-
vault: {
|
|
28
|
-
endpoint: 'http://127.0.0.1:8200',
|
|
29
|
-
token: 'root',
|
|
30
|
-
},
|
|
31
|
-
zookeeper: {
|
|
32
|
-
host: 'localhost:2181',
|
|
33
|
-
lockDirectory: '/SquidLocks',
|
|
34
|
-
},
|
|
35
|
-
sharedMongo: {
|
|
36
|
-
connectionString: 'mongodb://mongo:27017',
|
|
37
|
-
user: 'root',
|
|
38
|
-
},
|
|
39
|
-
datadog: {
|
|
40
|
-
datadogRegion: 'us5',
|
|
41
|
-
agentUrl: 'http://localhost:8126',
|
|
42
|
-
envName: 'local',
|
|
43
|
-
},
|
|
44
|
-
snowflake: {
|
|
45
|
-
account: 'RXOEPPR-SQUID_CLOUD_DEV',
|
|
46
|
-
username: 'DEV_SQUID',
|
|
47
|
-
password: '8S3uEkgrdJv8f',
|
|
48
|
-
database: 'DEV_METRICS',
|
|
49
|
-
schema: 'PUBLIC',
|
|
50
|
-
warehouse: 'compute_wh',
|
|
51
|
-
role: 'DEV_METRICS',
|
|
52
|
-
},
|
|
53
|
-
pinecone: {
|
|
54
|
-
environment: 'asia-southeast1-gcp-free',
|
|
55
|
-
indexName: 'free-test-index',
|
|
56
|
-
},
|
|
57
|
-
weaviate: {
|
|
58
|
-
scheme: 'http',
|
|
59
|
-
host: 'localhost:8081',
|
|
60
|
-
apiKey: undefined,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=local.environment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local.environment.js","sourceRoot":"","sources":["../../../../../internal-common/src/environment/local.environment.ts"],"names":[],"mappings":";;;AAGa,QAAA,gBAAgB,GAAoB;IAC/C,MAAM,EAAE,WAAW;IACnB,WAAW,EAAE,OAAO;IACpB,QAAQ,EAAE,wBAAwB;IAClC,iBAAiB,EAAE,CAAC;IACpB,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,OAA+B;IAC5C,cAAc,EAAE,qBAAqB;IACrC,MAAM,EAAE;QACN,OAAO,EAAE,uBAAuB;KACjC;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,mBAAmB;QAC3B,WAAW,EAAE,wCAAwC;KACtD;IACD,KAAK,EAAE;QACL,WAAW,EAAE,CAAC,8BAA8B,CAAC;QAC7C,wBAAwB,EAAE,KAAK;KAChC;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,uBAAuB;KAClC;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,uBAAuB;QACjC,KAAK,EAAE,MAAM;KACd;IACD,SAAS,EAAE;QACT,IAAI,EAAE,gBAAgB;QACtB,aAAa,EAAE,aAAa;KAC7B;IACD,WAAW,EAAE;QACX,gBAAgB,EAAE,uBAAuB;QACzC,IAAI,EAAE,MAAM;KACb;IACD,OAAO,EAAE;QACP,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,OAAO;KACjB;IACD,SAAS,EAAE;QACT,OAAO,EAAE,yBAAyB;QAClC,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,eAAe;QACzB,QAAQ,EAAE,aAAa;QACvB,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,YAAY;QACvB,IAAI,EAAE,aAAa;KACpB;IACD,QAAQ,EAAE;QACR,WAAW,EAAE,0BAA0B;QACvC,SAAS,EAAE,iBAAiB;KAC7B;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,SAAS;KAClB;CACF,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.CustomExceptionFilter = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const core_1 = require("@nestjs/core");
|
|
12
|
-
const common_2 = require("../../../common/src");
|
|
13
|
-
let CustomExceptionFilter = class CustomExceptionFilter extends core_1.BaseExceptionFilter {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.logger = new common_1.Logger('CustomExceptionFilter');
|
|
17
|
-
}
|
|
18
|
-
catch(err, host) {
|
|
19
|
-
const isProd = process.env['NODE_ENV'] === 'prod';
|
|
20
|
-
if (err instanceof common_2.ValidationError) {
|
|
21
|
-
this.logger.error(err);
|
|
22
|
-
return super.catch(new common_1.HttpException({
|
|
23
|
-
message: err.message,
|
|
24
|
-
statusCode: err.statusCode,
|
|
25
|
-
details: err.details,
|
|
26
|
-
stack: isProd ? undefined : err.stack,
|
|
27
|
-
}, err.statusCode), host);
|
|
28
|
-
}
|
|
29
|
-
if (!isProd && err instanceof Error) {
|
|
30
|
-
this.logger.error(`Uncaught exception: ${err.message}`, err.stack);
|
|
31
|
-
return super.catch(new common_1.HttpException({
|
|
32
|
-
message: err.message,
|
|
33
|
-
statusCode: common_1.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
34
|
-
stack: err.stack,
|
|
35
|
-
}, common_1.HttpStatus.INTERNAL_SERVER_ERROR), host);
|
|
36
|
-
}
|
|
37
|
-
return super.catch(err, host);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.CustomExceptionFilter = CustomExceptionFilter;
|
|
41
|
-
exports.CustomExceptionFilter = CustomExceptionFilter = __decorate([
|
|
42
|
-
(0, common_1.Injectable)(),
|
|
43
|
-
(0, common_1.Catch)()
|
|
44
|
-
], CustomExceptionFilter);
|
|
45
|
-
//# sourceMappingURL=custom-exception.filter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"custom-exception.filter.js","sourceRoot":"","sources":["../../../../../internal-common/src/filters/custom-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAqG;AACrG,uCAAmD;AACnD,gDAAqD;AAI9C,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,0BAAmB;IAAvD;;QACY,WAAM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2
|
-
export * from './code-executor.types';
|
|
3
|
-
export * from './dao.types';
|
|
4
|
-
export * from './environment';
|
|
5
|
-
export * from './filters/custom-exception.filter';
|
|
6
|
-
export * from './interceptors/body.interceptor';
|
|
7
|
-
export * from './kafka-observability-publisher';
|
|
8
|
-
export * from './kafka/kafka.manager';
|
|
9
|
-
export * from './kafka/kafka.types';
|
|
10
|
-
export * from './local-dev.types';
|
|
11
|
-
export { ObservabilityPublisher } from './observability-publisher';
|
|
12
|
-
export * from './observability.types';
|
|
13
|
-
export * from './shutdown.manager';
|
|
14
|
-
export * from './utils';
|
|
15
|
-
export * from './utils/index';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ObservabilityPublisher = void 0;
|
|
18
|
-
__exportStar(require("./async-queue"), exports);
|
|
19
|
-
__exportStar(require("./code-executor.types"), exports);
|
|
20
|
-
__exportStar(require("./dao.types"), exports);
|
|
21
|
-
__exportStar(require("./environment"), exports);
|
|
22
|
-
__exportStar(require("./filters/custom-exception.filter"), exports);
|
|
23
|
-
__exportStar(require("./interceptors/body.interceptor"), exports);
|
|
24
|
-
__exportStar(require("./kafka-observability-publisher"), exports);
|
|
25
|
-
__exportStar(require("./kafka/kafka.manager"), exports);
|
|
26
|
-
__exportStar(require("./kafka/kafka.types"), exports);
|
|
27
|
-
__exportStar(require("./local-dev.types"), exports);
|
|
28
|
-
var observability_publisher_1 = require("./observability-publisher");
|
|
29
|
-
Object.defineProperty(exports, "ObservabilityPublisher", { enumerable: true, get: function () { return observability_publisher_1.ObservabilityPublisher; } });
|
|
30
|
-
__exportStar(require("./observability.types"), exports);
|
|
31
|
-
__exportStar(require("./shutdown.manager"), exports);
|
|
32
|
-
__exportStar(require("./utils"), exports);
|
|
33
|
-
__exportStar(require("./utils/index"), exports);
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../internal-common/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,wDAAsC;AACtC,8CAA4B;AAC5B,gDAA8B;AAC9B,oEAAkD;AAClD,kEAAgD;AAChD,kEAAgD;AAChD,wDAAsC;AACtC,sDAAoC;AACpC,oDAAkC;AAClC,qEAAmE;AAA1D,iIAAA,sBAAsB,OAAA;AAC/B,wDAAsC;AACtC,qDAAmC;AACnC,0CAAwB;AACxB,gDAA8B"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.BodyInterceptor = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const common_2 = require("../../../common/src");
|
|
12
|
-
let BodyInterceptor = class BodyInterceptor {
|
|
13
|
-
async intercept(ctx, next) {
|
|
14
|
-
if (ctx.getType() !== 'http')
|
|
15
|
-
return next.handle();
|
|
16
|
-
const httpRequest = ctx.switchToHttp().getRequest();
|
|
17
|
-
httpRequest.body = httpRequest.rawBody ? (0, common_2.deserializeObj)(httpRequest.rawBody.toString()) : {};
|
|
18
|
-
return next.handle();
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.BodyInterceptor = BodyInterceptor;
|
|
22
|
-
exports.BodyInterceptor = BodyInterceptor = __decorate([
|
|
23
|
-
(0, common_1.Injectable)()
|
|
24
|
-
], BodyInterceptor);
|
|
25
|
-
//# sourceMappingURL=body.interceptor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"body.interceptor.js","sourceRoot":"","sources":["../../../../../internal-common/src/interceptors/body.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4F;AAC5F,gDAAoD;AAI7C,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,KAAK,CAAC,SAAS,CAAC,GAAqB,EAAE,IAAiB;QACtD,IAAI,GAAG,CAAC,OAAO,EAAE,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;QACnD,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,uBAAc,EAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7F,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF,CAAA;AAPY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;GACA,eAAe,CAO3B"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HeartbeatProvider } from '@squidcloud/common';
|
|
2
|
-
import { KafkaConnectionConfig, MessageEnvelope, TopicId } from './kafka.types';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
export declare class KafkaManager implements HeartbeatProvider {
|
|
5
|
-
private readonly connectionConfig;
|
|
6
|
-
private kafka;
|
|
7
|
-
private admin;
|
|
8
|
-
private readonly producerMap;
|
|
9
|
-
private readonly pubSubSubjectMap;
|
|
10
|
-
constructor(connectionConfig: KafkaConnectionConfig);
|
|
11
|
-
publishMessage<T>(topicId: TopicId, message: T, key: string): Promise<void>;
|
|
12
|
-
observePubSubTopic<T>(topicId: TopicId): Observable<T>;
|
|
13
|
-
observeTopic<T>(topicId: TopicId): Observable<MessageEnvelope<T>>;
|
|
14
|
-
observeBatchTopic<T>(topicId: TopicId): Observable<Array<MessageEnvelope<T>>>;
|
|
15
|
-
sendMessage<T>(topicId: TopicId, message: T, key: string): Promise<void>;
|
|
16
|
-
sendMessages<T>(topicId: TopicId, messages: Array<{
|
|
17
|
-
message: T;
|
|
18
|
-
key: string;
|
|
19
|
-
}>): Promise<void>;
|
|
20
|
-
private subscribeBatchAndRun;
|
|
21
|
-
checkHeartbeat(): Promise<void>;
|
|
22
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KafkaManager = void 0;
|
|
4
|
-
const node_process_1 = require("node:process");
|
|
5
|
-
const common_1 = require("../../../common/src");
|
|
6
|
-
const kafkajs_1 = require("kafkajs");
|
|
7
|
-
const rxjs_1 = require("rxjs");
|
|
8
|
-
const assertic_1 = require("assertic");
|
|
9
|
-
class KafkaManager {
|
|
10
|
-
constructor(connectionConfig) {
|
|
11
|
-
this.connectionConfig = connectionConfig;
|
|
12
|
-
this.producerMap = {};
|
|
13
|
-
this.pubSubSubjectMap = {};
|
|
14
|
-
const config = {
|
|
15
|
-
clientId: (0, common_1.generateId)(),
|
|
16
|
-
brokers: connectionConfig.clusterUrls,
|
|
17
|
-
logCreator: connectionConfig.logAdapter,
|
|
18
|
-
sasl: connectionConfig.sasl,
|
|
19
|
-
ssl: connectionConfig.ssl,
|
|
20
|
-
logLevel: kafkajs_1.logLevel.WARN,
|
|
21
|
-
};
|
|
22
|
-
this.kafka = new kafkajs_1.Kafka(config);
|
|
23
|
-
this.admin = this.kafka.admin();
|
|
24
|
-
}
|
|
25
|
-
async publishMessage(topicId, message, key) {
|
|
26
|
-
await this.sendMessage(topicId, message, key);
|
|
27
|
-
}
|
|
28
|
-
observePubSubTopic(topicId) {
|
|
29
|
-
if (this.pubSubSubjectMap[topicId]) {
|
|
30
|
-
return this.pubSubSubjectMap[topicId];
|
|
31
|
-
}
|
|
32
|
-
const subject = new rxjs_1.Subject();
|
|
33
|
-
const consumer = this.kafka.consumer({
|
|
34
|
-
groupId: `${topicId}-group - ${(0, common_1.generateId)()}`,
|
|
35
|
-
sessionTimeout: this.connectionConfig.consumerSessionTimeoutMs,
|
|
36
|
-
});
|
|
37
|
-
const obs = (0, rxjs_1.from)(this.subscribeBatchAndRun(consumer, topicId, subject)).pipe((0, rxjs_1.switchMap)(() => subject), (0, rxjs_1.finalize)(async () => {
|
|
38
|
-
delete this.pubSubSubjectMap[topicId];
|
|
39
|
-
await consumer.disconnect();
|
|
40
|
-
}), (0, rxjs_1.mergeMap)(a => a), (0, rxjs_1.tap)(a => a.commit()), (0, rxjs_1.map)(a => a.data), (0, rxjs_1.share)());
|
|
41
|
-
this.pubSubSubjectMap[topicId] = obs;
|
|
42
|
-
return obs;
|
|
43
|
-
}
|
|
44
|
-
observeTopic(topicId) {
|
|
45
|
-
return this.observeBatchTopic(topicId).pipe((0, rxjs_1.mergeMap)(a => a));
|
|
46
|
-
}
|
|
47
|
-
observeBatchTopic(topicId) {
|
|
48
|
-
const consumer = this.kafka.consumer({
|
|
49
|
-
groupId: `${topicId}-group`,
|
|
50
|
-
sessionTimeout: this.connectionConfig.consumerSessionTimeoutMs,
|
|
51
|
-
heartbeatInterval: 1000,
|
|
52
|
-
});
|
|
53
|
-
const subject = new rxjs_1.Subject();
|
|
54
|
-
return (0, rxjs_1.from)(this.subscribeBatchAndRun(consumer, topicId, subject)).pipe((0, rxjs_1.switchMap)(() => subject), (0, rxjs_1.finalize)(async () => {
|
|
55
|
-
await consumer.disconnect();
|
|
56
|
-
}), (0, rxjs_1.share)());
|
|
57
|
-
}
|
|
58
|
-
async sendMessage(topicId, message, key) {
|
|
59
|
-
await this.sendMessages(topicId, [{ message, key }]);
|
|
60
|
-
}
|
|
61
|
-
async sendMessages(topicId, messages) {
|
|
62
|
-
if (!this.producerMap[topicId]) {
|
|
63
|
-
const producer = this.kafka.producer({
|
|
64
|
-
createPartitioner: kafkajs_1.Partitioners.DefaultPartitioner,
|
|
65
|
-
retry: {
|
|
66
|
-
retries: 5,
|
|
67
|
-
initialRetryTime: 300,
|
|
68
|
-
maxRetryTime: 5000,
|
|
69
|
-
},
|
|
70
|
-
idempotent: false,
|
|
71
|
-
transactionTimeout: 30000,
|
|
72
|
-
});
|
|
73
|
-
this.producerMap[topicId] = producer.connect().then(() => producer);
|
|
74
|
-
}
|
|
75
|
-
const producer = await this.producerMap[topicId];
|
|
76
|
-
const messagesWithValue = messages.map(({ message, key }) => {
|
|
77
|
-
return { value: (0, common_1.serializeObj)(message), key, timestamp: node_process_1.default.hrtime.bigint().toString() };
|
|
78
|
-
});
|
|
79
|
-
try {
|
|
80
|
-
await producer.send({ topic: topicId, messages: messagesWithValue });
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
console.error('Error sending messages to Kafka', e, messagesWithValue);
|
|
84
|
-
throw e;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async subscribeBatchAndRun(consumer, topicId, subject) {
|
|
88
|
-
try {
|
|
89
|
-
await consumer.connect();
|
|
90
|
-
await consumer.subscribe({ topic: topicId, fromBeginning: false });
|
|
91
|
-
await consumer.run({
|
|
92
|
-
eachBatchAutoResolve: true,
|
|
93
|
-
eachBatch: async ({ batch, resolveOffset }) => {
|
|
94
|
-
const messageEnvelopes = batch.messages
|
|
95
|
-
.filter(message => message.value !== null)
|
|
96
|
-
.map(message => {
|
|
97
|
-
const data = (0, common_1.deserializeObj)((0, assertic_1.truthy)(message.value).toString());
|
|
98
|
-
return {
|
|
99
|
-
data,
|
|
100
|
-
timestamp: parseInt(message.timestamp),
|
|
101
|
-
offset: message.offset,
|
|
102
|
-
partition: batch.partition,
|
|
103
|
-
topicId,
|
|
104
|
-
commit: () => {
|
|
105
|
-
resolveOffset(message.offset);
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
if (messageEnvelopes.length) {
|
|
110
|
-
subject.next(messageEnvelopes);
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
catch (e) {
|
|
116
|
-
console.error(`Error subscribing to Kafka (topicId: ${topicId})`, e);
|
|
117
|
-
throw e;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
async checkHeartbeat() {
|
|
121
|
-
await this.admin.describeCluster();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.KafkaManager = KafkaManager;
|
|
125
|
-
//# sourceMappingURL=kafka.manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kafka.manager.js","sourceRoot":"","sources":["../../../../../internal-common/src/kafka/kafka.manager.ts"],"names":[],"mappings":";;;AAAA,+CAAmC;AACnC,gDAAiG;AACjG,qCAAgG;AAEhG,+BAAiG;AACjG,uCAAkC;AAElC,MAAa,YAAY;IAMvB,YAA6B,gBAAuC;QAAvC,qBA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,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,wCAAwC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC;YACrE,MAAM,CAAC,CAAC;SACT;IACH,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC;CACF;AAxJD,oCAwJC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { LogEntry, logLevel, Mechanism, SASLOptions } from 'kafkajs';
|
|
2
|
-
export type TopicId = string;
|
|
3
|
-
export interface MessageEnvelope<T> {
|
|
4
|
-
data: T;
|
|
5
|
-
offset: string;
|
|
6
|
-
timestamp: number;
|
|
7
|
-
partition: number;
|
|
8
|
-
topicId: TopicId;
|
|
9
|
-
commit: () => void;
|
|
10
|
-
}
|
|
11
|
-
export interface KafkaConnectionConfig {
|
|
12
|
-
clusterUrls: string[];
|
|
13
|
-
logAdapter?: (logLevel: logLevel) => (entry: LogEntry) => void;
|
|
14
|
-
ssl: boolean;
|
|
15
|
-
sasl?: SASLOptions | Mechanism;
|
|
16
|
-
consumerSessionTimeoutMs: number;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kafka.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/kafka/kafka.types.ts"],"names":[],"mappings":""}
|