@ductape/sdk 0.0.4-v8 → 0.0.4-v9
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/api/services/processorApi.service.d.ts +12 -2
- package/dist/api/services/processorApi.service.js +12 -2
- package/dist/api/services/processorApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +3 -1
- package/dist/api/services/productsApi.service.js +11 -0
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/urls.d.ts +3 -1
- package/dist/api/urls.js +4 -2
- package/dist/api/urls.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.js +48 -7
- package/dist/index.js.map +1 -1
- package/dist/inputs/inputs.service.js +2 -2
- package/dist/inputs/inputs.service.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +8 -5
- package/dist/processor/services/processor.service.js +192 -62
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/processor/utils/processor.utils.d.ts +3 -0
- package/dist/processor/utils/processor.utils.js +55 -1
- package/dist/processor/utils/processor.utils.js.map +1 -1
- package/dist/products/services/products.service.d.ts +4 -3
- package/dist/products/services/products.service.js +18 -2
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/types/appBuilder.types.d.ts +1 -11
- package/dist/types/index.types.d.ts +5 -0
- package/dist/types/index.types.js.map +1 -1
- package/dist/types/processor.types.d.ts +56 -12
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +11 -3
- package/dist/types/productsBuilder.types.js +3 -0
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Queue } from 'bullmq';
|
|
1
2
|
import { RedisClientType } from 'redis';
|
|
2
3
|
export interface IDuctapeInit {
|
|
3
4
|
user_id: string;
|
|
@@ -18,6 +19,10 @@ export interface IBuilderInit {
|
|
|
18
19
|
token: string;
|
|
19
20
|
env_type: EnvType;
|
|
20
21
|
redis_client?: RedisClientType;
|
|
22
|
+
queues?: {
|
|
23
|
+
health: Queue;
|
|
24
|
+
jobs: Queue;
|
|
25
|
+
};
|
|
21
26
|
}
|
|
22
27
|
export interface ILoggerInit extends IBuilderInit {
|
|
23
28
|
product_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/types/index.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/types/index.types.ts"],"names":[],"mappings":";;;AAWA,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,8BAAmB,CAAA;IACnB,oCAAyB,CAAA;IACzB,0BAAe,CAAA;AACjB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB"}
|
|
@@ -3,31 +3,42 @@ import { AWSSQSConfig, GooglePubSubConfig, IActionRequest, IDbActionRequest, IDe
|
|
|
3
3
|
import { HttpMethods, Notifiers } from './enums';
|
|
4
4
|
import ObjectId from 'bson-objectid';
|
|
5
5
|
import { IParsedSample } from './inputs.types';
|
|
6
|
-
export interface
|
|
6
|
+
export interface IProcessorInputGeneric {
|
|
7
7
|
product: string;
|
|
8
8
|
env: string;
|
|
9
|
-
input: Record<string, unknown>;
|
|
10
9
|
tag: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IProcessorInputSessionGeneric extends IProcessorInputGeneric {
|
|
11
12
|
session?: {
|
|
12
13
|
tag: string;
|
|
13
14
|
token: string;
|
|
14
15
|
};
|
|
16
|
+
cache?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IProcessorInput extends IProcessorInputSessionGeneric {
|
|
19
|
+
input: Record<string, unknown>;
|
|
15
20
|
}
|
|
16
21
|
export interface IRefreshTokenReq {
|
|
17
22
|
product_tag: string;
|
|
18
23
|
env: string;
|
|
19
24
|
refreshToken: string;
|
|
25
|
+
identifier: string;
|
|
26
|
+
start_at: number;
|
|
27
|
+
end_at: number;
|
|
28
|
+
session_tag: string;
|
|
29
|
+
data: string;
|
|
30
|
+
session_id: string;
|
|
20
31
|
}
|
|
21
|
-
export interface ISessionInput {
|
|
22
|
-
product: string;
|
|
23
|
-
env: string;
|
|
24
|
-
tag: string;
|
|
32
|
+
export interface ISessionInput extends IProcessorInputGeneric {
|
|
25
33
|
data: Record<string, unknown>;
|
|
26
34
|
}
|
|
27
|
-
export interface ISessionPayload {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
export interface ISessionPayload extends IProcessorInputGeneric {
|
|
36
|
+
token: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ISessionRefreshPayload extends IProcessorInputGeneric {
|
|
39
|
+
refreshToken: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ISession extends IProcessorInputGeneric {
|
|
31
42
|
token: string;
|
|
32
43
|
}
|
|
33
44
|
export interface ISessionOutput {
|
|
@@ -213,15 +224,31 @@ export interface IActionProcessorInput {
|
|
|
213
224
|
input: IActionRequest;
|
|
214
225
|
event: string;
|
|
215
226
|
retries?: number;
|
|
227
|
+
session?: {
|
|
228
|
+
tag: string;
|
|
229
|
+
token: string;
|
|
230
|
+
};
|
|
216
231
|
}
|
|
217
232
|
export interface IJobProcessorInput {
|
|
218
233
|
env: string;
|
|
219
234
|
product: string;
|
|
220
|
-
|
|
235
|
+
event: string;
|
|
221
236
|
cache?: string;
|
|
237
|
+
retries: number;
|
|
222
238
|
input: IActionRequest | INotificationRequest | IDbActionRequest | IFunctionRequest | IStorageRequest | Record<string, unknown> | IPublishRequest;
|
|
223
|
-
event: string;
|
|
224
239
|
start_at: number;
|
|
240
|
+
session?: {
|
|
241
|
+
tag: string;
|
|
242
|
+
token: string;
|
|
243
|
+
};
|
|
244
|
+
repeat?: IJobRepeatOptions;
|
|
245
|
+
}
|
|
246
|
+
interface IJobRepeatOptions {
|
|
247
|
+
cron?: string;
|
|
248
|
+
every?: number;
|
|
249
|
+
limit?: number;
|
|
250
|
+
endDate?: number | string;
|
|
251
|
+
tz?: string;
|
|
225
252
|
}
|
|
226
253
|
export interface IFileReadResult extends IStorageRequest {
|
|
227
254
|
}
|
|
@@ -233,6 +260,10 @@ export interface IStorageProcessorInput {
|
|
|
233
260
|
input: IStorageRequest;
|
|
234
261
|
event: string;
|
|
235
262
|
retries?: number;
|
|
263
|
+
session?: {
|
|
264
|
+
tag: string;
|
|
265
|
+
token: string;
|
|
266
|
+
};
|
|
236
267
|
}
|
|
237
268
|
export interface IFunctionProcessorInput {
|
|
238
269
|
env: string;
|
|
@@ -255,6 +286,10 @@ export interface IMessageBrokerPublishInput {
|
|
|
255
286
|
cache?: string;
|
|
256
287
|
product: string;
|
|
257
288
|
input: IPublishRequest;
|
|
289
|
+
session?: {
|
|
290
|
+
tag: string;
|
|
291
|
+
token: string;
|
|
292
|
+
};
|
|
258
293
|
}
|
|
259
294
|
export interface IMessageBrokerSubscribeInput {
|
|
260
295
|
env: string;
|
|
@@ -269,6 +304,10 @@ export interface IDBActionProcessorInput {
|
|
|
269
304
|
input: IDbActionRequest;
|
|
270
305
|
event: string;
|
|
271
306
|
retries?: number;
|
|
307
|
+
session?: {
|
|
308
|
+
tag: string;
|
|
309
|
+
token: string;
|
|
310
|
+
};
|
|
272
311
|
}
|
|
273
312
|
export interface INotificationProcessorInput {
|
|
274
313
|
env: string;
|
|
@@ -277,6 +316,10 @@ export interface INotificationProcessorInput {
|
|
|
277
316
|
event: string;
|
|
278
317
|
input: INotificationRequest;
|
|
279
318
|
retries?: number;
|
|
319
|
+
session?: {
|
|
320
|
+
tag: string;
|
|
321
|
+
token: string;
|
|
322
|
+
};
|
|
280
323
|
}
|
|
281
324
|
export interface IWebhooks {
|
|
282
325
|
uuid: string;
|
|
@@ -309,3 +352,4 @@ export interface IFileURLPayload {
|
|
|
309
352
|
__v?: number;
|
|
310
353
|
_id?: string;
|
|
311
354
|
}
|
|
355
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor.types.js","sourceRoot":"","sources":["../../src/types/processor.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"processor.types.js","sourceRoot":"","sources":["../../src/types/processor.types.ts"],"names":[],"mappings":";;;AAmLA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;AACjB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB"}
|
|
@@ -227,7 +227,10 @@ export declare enum JobEventTypes {
|
|
|
227
227
|
DATABASE_ACTION = "database_action",
|
|
228
228
|
FUNCTION = "function",
|
|
229
229
|
STORAGE = "storage",
|
|
230
|
-
PUBLISH = "publish"
|
|
230
|
+
PUBLISH = "publish",
|
|
231
|
+
FALLBACK = "fallback",
|
|
232
|
+
QUOTA = "quota",
|
|
233
|
+
FEATURE = "feature"
|
|
231
234
|
}
|
|
232
235
|
export interface IProductJobs {
|
|
233
236
|
_id?: string;
|
|
@@ -325,6 +328,7 @@ export interface IFeatureEvent {
|
|
|
325
328
|
env?: IProductEnv;
|
|
326
329
|
return?: boolean;
|
|
327
330
|
cache?: string;
|
|
331
|
+
start_at?: number;
|
|
328
332
|
}
|
|
329
333
|
export declare enum Conditions {
|
|
330
334
|
LOOP = "loop",
|
|
@@ -572,12 +576,16 @@ export interface IRemoteCache {
|
|
|
572
576
|
component_tag: string;
|
|
573
577
|
component_type: string;
|
|
574
578
|
}
|
|
575
|
-
export interface
|
|
579
|
+
export interface IPaginationOptions {
|
|
576
580
|
page: number;
|
|
577
581
|
limit: number;
|
|
582
|
+
}
|
|
583
|
+
export interface IFetchFilesPayload extends IPaginationOptions {
|
|
584
|
+
product: string;
|
|
578
585
|
event: string;
|
|
579
586
|
}
|
|
580
|
-
export interface
|
|
587
|
+
export interface IFetchUsersPayload extends IPaginationOptions {
|
|
588
|
+
session: string;
|
|
581
589
|
product: string;
|
|
582
590
|
}
|
|
583
591
|
export interface FetchRemoteCachePayload extends Partial<Pick<IRemoteCache, 'cache_tag' | 'component_tag' | 'component_type' | 'expiry' | 'product_tag'>> {
|
|
@@ -42,6 +42,9 @@ var JobEventTypes;
|
|
|
42
42
|
JobEventTypes["FUNCTION"] = "function";
|
|
43
43
|
JobEventTypes["STORAGE"] = "storage";
|
|
44
44
|
JobEventTypes["PUBLISH"] = "publish";
|
|
45
|
+
JobEventTypes["FALLBACK"] = "fallback";
|
|
46
|
+
JobEventTypes["QUOTA"] = "quota";
|
|
47
|
+
JobEventTypes["FEATURE"] = "feature";
|
|
45
48
|
})(JobEventTypes || (exports.JobEventTypes = JobEventTypes = {}));
|
|
46
49
|
exports.ValidOperators = ['>', '<', '>=', '<=', '==', '!=='];
|
|
47
50
|
var Conditions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productsBuilder.types.js","sourceRoot":"","sources":["../../src/types/productsBuilder.types.ts"],"names":[],"mappings":";;;AA6IA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,+BAAW,CAAA;IACX,+BAAW,CAAA;AACb,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAeD,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;AACjB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;AACrB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAuCD,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,sCAAe,CAAA;IACf,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,8CAAuB,CAAA;AACzB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAqBD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,kCAAa,CAAA;AACf,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAqBD,IAAY,
|
|
1
|
+
{"version":3,"file":"productsBuilder.types.js","sourceRoot":"","sources":["../../src/types/productsBuilder.types.ts"],"names":[],"mappings":";;;AA6IA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,+BAAW,CAAA;IACX,+BAAW,CAAA;AACb,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAeD,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;AACjB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;AACrB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAuCD,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,sCAAe,CAAA;IACf,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,8CAAuB,CAAA;AACzB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAqBD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,kCAAa,CAAA;AACf,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAqBD,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,8CAA6B,CAAA;IAC7B,oDAAmC,CAAA;IACnC,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,oCAAmB,CAAA;AACrB,CAAC,EA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": "0.0.
|
|
3
|
+
"version": "0.0.4v9",
|
|
4
4
|
"description": "sdk for building ductaped products",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"aws-sdk": "^2.1692.0",
|
|
34
34
|
"axios": "^1.5.0",
|
|
35
35
|
"bson-objectid": "^2.0.4",
|
|
36
|
+
"bullmq": "^5.53.2",
|
|
36
37
|
"crypto-js": "^4.2.0",
|
|
37
38
|
"date-fns": "^4.1.0",
|
|
38
39
|
"dt-sql-parser": "^4.0.2",
|