@mimicprotocol/sdk 0.0.1-rc.11 → 0.0.1-rc.13
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/axia/validators.d.ts +454 -36
- package/dist/axia/validators.d.ts.map +1 -1
- package/dist/axia/validators.js +5 -1
- package/dist/axia/validators.js.map +1 -1
- package/dist/client/domains/ConfigsClient.d.ts +1 -1
- package/dist/client/domains/ConfigsClient.d.ts.map +1 -1
- package/dist/client/domains/ConfigsClient.js +2 -1
- package/dist/client/domains/ConfigsClient.js.map +1 -1
- package/dist/oracle/eip712Types.d.ts +18 -0
- package/dist/oracle/eip712Types.d.ts.map +1 -1
- package/dist/oracle/eip712Types.js +17 -0
- package/dist/oracle/eip712Types.js.map +1 -1
- package/dist/oracle/types.d.ts +8 -1
- package/dist/oracle/types.d.ts.map +1 -1
- package/dist/oracle/validators.d.ts +236 -12
- package/dist/oracle/validators.d.ts.map +1 -1
- package/dist/oracle/validators.js +16 -1
- package/dist/oracle/validators.js.map +1 -1
- package/dist/registry/validators.d.ts +0 -6
- package/dist/registry/validators.d.ts.map +1 -1
- package/dist/registry/validators.js +0 -1
- package/dist/registry/validators.js.map +1 -1
- package/dist/relayer/validators.d.ts +334 -30
- package/dist/relayer/validators.d.ts.map +1 -1
- package/dist/runner/validators.d.ts +146 -12
- package/dist/runner/validators.d.ts.map +1 -1
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/index.js +1 -0
- package/dist/shared/utils/index.js.map +1 -1
- package/dist/shared/utils/time.d.ts +11 -0
- package/dist/shared/utils/time.d.ts.map +1 -0
- package/dist/shared/utils/time.js +42 -0
- package/dist/shared/utils/time.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/relayer/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO1C,CAAA"}
|
|
@@ -58,7 +58,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
58
58
|
result: {
|
|
59
59
|
value: string;
|
|
60
60
|
};
|
|
61
|
-
signature: string;
|
|
62
61
|
query: {
|
|
63
62
|
params: {
|
|
64
63
|
chainId: number;
|
|
@@ -69,11 +68,11 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
69
68
|
name: "EvmCallQuery";
|
|
70
69
|
hash: string;
|
|
71
70
|
};
|
|
71
|
+
signature: string;
|
|
72
72
|
}, {
|
|
73
73
|
result: {
|
|
74
74
|
value: string;
|
|
75
75
|
};
|
|
76
|
-
signature: string;
|
|
77
76
|
query: {
|
|
78
77
|
params: {
|
|
79
78
|
chainId: number;
|
|
@@ -84,6 +83,7 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
84
83
|
name: "EvmCallQuery";
|
|
85
84
|
hash: string;
|
|
86
85
|
};
|
|
86
|
+
signature: string;
|
|
87
87
|
}>, z.ZodObject<{
|
|
88
88
|
signature: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
89
89
|
query: z.ZodObject<{
|
|
@@ -146,7 +146,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
146
146
|
result: {
|
|
147
147
|
value: string;
|
|
148
148
|
};
|
|
149
|
-
signature: string;
|
|
150
149
|
query: {
|
|
151
150
|
params: {
|
|
152
151
|
timestamp: number;
|
|
@@ -158,11 +157,11 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
158
157
|
name: "TokenPriceQuery";
|
|
159
158
|
hash: string;
|
|
160
159
|
};
|
|
160
|
+
signature: string;
|
|
161
161
|
}, {
|
|
162
162
|
result: {
|
|
163
163
|
value: string;
|
|
164
164
|
};
|
|
165
|
-
signature: string;
|
|
166
165
|
query: {
|
|
167
166
|
params: {
|
|
168
167
|
timestamp: number;
|
|
@@ -174,6 +173,7 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
174
173
|
name: "TokenPriceQuery";
|
|
175
174
|
hash: string;
|
|
176
175
|
};
|
|
176
|
+
signature: string;
|
|
177
177
|
}>, z.ZodObject<{
|
|
178
178
|
signature: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
179
179
|
query: z.ZodObject<{
|
|
@@ -298,7 +298,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
298
298
|
balance: string;
|
|
299
299
|
}[];
|
|
300
300
|
};
|
|
301
|
-
signature: string;
|
|
302
301
|
query: {
|
|
303
302
|
params: {
|
|
304
303
|
timestamp: number;
|
|
@@ -314,6 +313,7 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
314
313
|
name: "RelevantTokensQuery";
|
|
315
314
|
hash: string;
|
|
316
315
|
};
|
|
316
|
+
signature: string;
|
|
317
317
|
}, {
|
|
318
318
|
result: {
|
|
319
319
|
value: {
|
|
@@ -324,7 +324,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
324
324
|
balance: string;
|
|
325
325
|
}[];
|
|
326
326
|
};
|
|
327
|
-
signature: string;
|
|
328
327
|
query: {
|
|
329
328
|
params: {
|
|
330
329
|
timestamp: number;
|
|
@@ -340,6 +339,105 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
340
339
|
name: "RelevantTokensQuery";
|
|
341
340
|
hash: string;
|
|
342
341
|
};
|
|
342
|
+
signature: string;
|
|
343
|
+
}>, z.ZodObject<{
|
|
344
|
+
signature: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
345
|
+
query: z.ZodObject<{
|
|
346
|
+
name: z.ZodLiteral<"SubgraphQuery">;
|
|
347
|
+
hash: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
348
|
+
params: z.ZodObject<{
|
|
349
|
+
chainId: z.ZodEffects<z.ZodNumber, number, number>;
|
|
350
|
+
timestamp: z.ZodEffects<z.ZodNumber, number, number>;
|
|
351
|
+
subgraphId: z.ZodString;
|
|
352
|
+
query: z.ZodString;
|
|
353
|
+
}, "strip", z.ZodTypeAny, {
|
|
354
|
+
chainId: number;
|
|
355
|
+
timestamp: number;
|
|
356
|
+
subgraphId: string;
|
|
357
|
+
query: string;
|
|
358
|
+
}, {
|
|
359
|
+
chainId: number;
|
|
360
|
+
timestamp: number;
|
|
361
|
+
subgraphId: string;
|
|
362
|
+
query: string;
|
|
363
|
+
}>;
|
|
364
|
+
}, "strip", z.ZodTypeAny, {
|
|
365
|
+
params: {
|
|
366
|
+
chainId: number;
|
|
367
|
+
timestamp: number;
|
|
368
|
+
subgraphId: string;
|
|
369
|
+
query: string;
|
|
370
|
+
};
|
|
371
|
+
name: "SubgraphQuery";
|
|
372
|
+
hash: string;
|
|
373
|
+
}, {
|
|
374
|
+
params: {
|
|
375
|
+
chainId: number;
|
|
376
|
+
timestamp: number;
|
|
377
|
+
subgraphId: string;
|
|
378
|
+
query: string;
|
|
379
|
+
};
|
|
380
|
+
name: "SubgraphQuery";
|
|
381
|
+
hash: string;
|
|
382
|
+
}>;
|
|
383
|
+
result: z.ZodObject<{
|
|
384
|
+
value: z.ZodObject<{
|
|
385
|
+
blockNumber: z.ZodNumber;
|
|
386
|
+
data: z.ZodString;
|
|
387
|
+
}, "strip", z.ZodTypeAny, {
|
|
388
|
+
data: string;
|
|
389
|
+
blockNumber: number;
|
|
390
|
+
}, {
|
|
391
|
+
data: string;
|
|
392
|
+
blockNumber: number;
|
|
393
|
+
}>;
|
|
394
|
+
}, "strip", z.ZodTypeAny, {
|
|
395
|
+
value: {
|
|
396
|
+
data: string;
|
|
397
|
+
blockNumber: number;
|
|
398
|
+
};
|
|
399
|
+
}, {
|
|
400
|
+
value: {
|
|
401
|
+
data: string;
|
|
402
|
+
blockNumber: number;
|
|
403
|
+
};
|
|
404
|
+
}>;
|
|
405
|
+
}, "strip", z.ZodTypeAny, {
|
|
406
|
+
result: {
|
|
407
|
+
value: {
|
|
408
|
+
data: string;
|
|
409
|
+
blockNumber: number;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
query: {
|
|
413
|
+
params: {
|
|
414
|
+
chainId: number;
|
|
415
|
+
timestamp: number;
|
|
416
|
+
subgraphId: string;
|
|
417
|
+
query: string;
|
|
418
|
+
};
|
|
419
|
+
name: "SubgraphQuery";
|
|
420
|
+
hash: string;
|
|
421
|
+
};
|
|
422
|
+
signature: string;
|
|
423
|
+
}, {
|
|
424
|
+
result: {
|
|
425
|
+
value: {
|
|
426
|
+
data: string;
|
|
427
|
+
blockNumber: number;
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
query: {
|
|
431
|
+
params: {
|
|
432
|
+
chainId: number;
|
|
433
|
+
timestamp: number;
|
|
434
|
+
subgraphId: string;
|
|
435
|
+
query: string;
|
|
436
|
+
};
|
|
437
|
+
name: "SubgraphQuery";
|
|
438
|
+
hash: string;
|
|
439
|
+
};
|
|
440
|
+
signature: string;
|
|
343
441
|
}>]>, "many">>;
|
|
344
442
|
hash: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
345
443
|
trigger: z.ZodObject<{
|
|
@@ -368,7 +466,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
368
466
|
result: {
|
|
369
467
|
value: string;
|
|
370
468
|
};
|
|
371
|
-
signature: string;
|
|
372
469
|
query: {
|
|
373
470
|
params: {
|
|
374
471
|
chainId: number;
|
|
@@ -379,11 +476,11 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
379
476
|
name: "EvmCallQuery";
|
|
380
477
|
hash: string;
|
|
381
478
|
};
|
|
479
|
+
signature: string;
|
|
382
480
|
} | {
|
|
383
481
|
result: {
|
|
384
482
|
value: string;
|
|
385
483
|
};
|
|
386
|
-
signature: string;
|
|
387
484
|
query: {
|
|
388
485
|
params: {
|
|
389
486
|
timestamp: number;
|
|
@@ -395,6 +492,7 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
395
492
|
name: "TokenPriceQuery";
|
|
396
493
|
hash: string;
|
|
397
494
|
};
|
|
495
|
+
signature: string;
|
|
398
496
|
} | {
|
|
399
497
|
result: {
|
|
400
498
|
value: {
|
|
@@ -405,7 +503,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
405
503
|
balance: string;
|
|
406
504
|
}[];
|
|
407
505
|
};
|
|
408
|
-
signature: string;
|
|
409
506
|
query: {
|
|
410
507
|
params: {
|
|
411
508
|
timestamp: number;
|
|
@@ -421,6 +518,25 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
421
518
|
name: "RelevantTokensQuery";
|
|
422
519
|
hash: string;
|
|
423
520
|
};
|
|
521
|
+
signature: string;
|
|
522
|
+
} | {
|
|
523
|
+
result: {
|
|
524
|
+
value: {
|
|
525
|
+
data: string;
|
|
526
|
+
blockNumber: number;
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
query: {
|
|
530
|
+
params: {
|
|
531
|
+
chainId: number;
|
|
532
|
+
timestamp: number;
|
|
533
|
+
subgraphId: string;
|
|
534
|
+
query: string;
|
|
535
|
+
};
|
|
536
|
+
name: "SubgraphQuery";
|
|
537
|
+
hash: string;
|
|
538
|
+
};
|
|
539
|
+
signature: string;
|
|
424
540
|
})[] | undefined;
|
|
425
541
|
}, {
|
|
426
542
|
timestamp: number;
|
|
@@ -438,7 +554,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
438
554
|
result: {
|
|
439
555
|
value: string;
|
|
440
556
|
};
|
|
441
|
-
signature: string;
|
|
442
557
|
query: {
|
|
443
558
|
params: {
|
|
444
559
|
chainId: number;
|
|
@@ -449,11 +564,11 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
449
564
|
name: "EvmCallQuery";
|
|
450
565
|
hash: string;
|
|
451
566
|
};
|
|
567
|
+
signature: string;
|
|
452
568
|
} | {
|
|
453
569
|
result: {
|
|
454
570
|
value: string;
|
|
455
571
|
};
|
|
456
|
-
signature: string;
|
|
457
572
|
query: {
|
|
458
573
|
params: {
|
|
459
574
|
timestamp: number;
|
|
@@ -465,6 +580,7 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
465
580
|
name: "TokenPriceQuery";
|
|
466
581
|
hash: string;
|
|
467
582
|
};
|
|
583
|
+
signature: string;
|
|
468
584
|
} | {
|
|
469
585
|
result: {
|
|
470
586
|
value: {
|
|
@@ -475,7 +591,6 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
475
591
|
balance: string;
|
|
476
592
|
}[];
|
|
477
593
|
};
|
|
478
|
-
signature: string;
|
|
479
594
|
query: {
|
|
480
595
|
params: {
|
|
481
596
|
timestamp: number;
|
|
@@ -491,6 +606,25 @@ export declare const RunExecutionRequestValidator: z.ZodObject<{
|
|
|
491
606
|
name: "RelevantTokensQuery";
|
|
492
607
|
hash: string;
|
|
493
608
|
};
|
|
609
|
+
signature: string;
|
|
610
|
+
} | {
|
|
611
|
+
result: {
|
|
612
|
+
value: {
|
|
613
|
+
data: string;
|
|
614
|
+
blockNumber: number;
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
query: {
|
|
618
|
+
params: {
|
|
619
|
+
chainId: number;
|
|
620
|
+
timestamp: number;
|
|
621
|
+
subgraphId: string;
|
|
622
|
+
query: string;
|
|
623
|
+
};
|
|
624
|
+
name: "SubgraphQuery";
|
|
625
|
+
hash: string;
|
|
626
|
+
};
|
|
627
|
+
signature: string;
|
|
494
628
|
})[] | undefined;
|
|
495
629
|
}>;
|
|
496
630
|
export declare const RunExecutionResultValidator: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/runner/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAML,WAAW,EAEZ,MAAM,WAAW,CAAA;AAElB,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/runner/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAML,WAAW,EAEZ,MAAM,WAAW,CAAA;AAElB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAavC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA"}
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./bytes"), exports);
|
|
|
19
19
|
__exportStar(require("./chains"), exports);
|
|
20
20
|
__exportStar(require("./numbers"), exports);
|
|
21
21
|
__exportStar(require("./random"), exports);
|
|
22
|
+
__exportStar(require("./time"), exports);
|
|
22
23
|
__exportStar(require("./tokens"), exports);
|
|
23
24
|
__exportStar(require("./validations"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,2CAAwB;AACxB,gDAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,yCAAsB;AACtB,2CAAwB;AACxB,gDAA6B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const SECOND = 1;
|
|
2
|
+
export declare const MINUTE: number;
|
|
3
|
+
export declare const HOUR: number;
|
|
4
|
+
export declare const DAY: number;
|
|
5
|
+
export declare const WEEK: number;
|
|
6
|
+
export declare const MONTH: number;
|
|
7
|
+
export declare const YEAR: number;
|
|
8
|
+
export declare function getNextCronDate(expression: string): Date;
|
|
9
|
+
export declare function includesDate(expression: string, date: number): boolean;
|
|
10
|
+
export declare function getDurationInMilliseconds(duration: string): number;
|
|
11
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/time.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,IAAI,CAAA;AACvB,eAAO,MAAM,MAAM,QAAc,CAAA;AACjC,eAAO,MAAM,IAAI,QAAc,CAAA;AAC/B,eAAO,MAAM,GAAG,QAAY,CAAA;AAC5B,eAAO,MAAM,IAAI,QAAU,CAAA;AAC3B,eAAO,MAAM,KAAK,QAAW,CAAA;AAC7B,eAAO,MAAM,IAAI,QAAa,CAAA;AAE9B,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGxD;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAGtE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBlE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.YEAR = exports.MONTH = exports.WEEK = exports.DAY = exports.HOUR = exports.MINUTE = exports.SECOND = void 0;
|
|
7
|
+
exports.getNextCronDate = getNextCronDate;
|
|
8
|
+
exports.includesDate = includesDate;
|
|
9
|
+
exports.getDurationInMilliseconds = getDurationInMilliseconds;
|
|
10
|
+
const cron_parser_1 = __importDefault(require("cron-parser"));
|
|
11
|
+
exports.SECOND = 1;
|
|
12
|
+
exports.MINUTE = exports.SECOND * 60;
|
|
13
|
+
exports.HOUR = exports.MINUTE * 60;
|
|
14
|
+
exports.DAY = exports.HOUR * 24;
|
|
15
|
+
exports.WEEK = exports.DAY * 7;
|
|
16
|
+
exports.MONTH = exports.DAY * 30;
|
|
17
|
+
exports.YEAR = exports.MONTH * 12;
|
|
18
|
+
function getNextCronDate(expression) {
|
|
19
|
+
const interval = cron_parser_1.default.parse(expression);
|
|
20
|
+
return interval.next().toDate();
|
|
21
|
+
}
|
|
22
|
+
function includesDate(expression, date) {
|
|
23
|
+
const interval = cron_parser_1.default.parse(expression);
|
|
24
|
+
return interval.includesDate(new Date(date));
|
|
25
|
+
}
|
|
26
|
+
function getDurationInMilliseconds(duration) {
|
|
27
|
+
const match = duration.match(/^(\d+)(s|m|h|d|w)$/);
|
|
28
|
+
if (!match)
|
|
29
|
+
throw new Error(`Invalid expression: ${duration}`);
|
|
30
|
+
const value = parseInt(match[1], 10);
|
|
31
|
+
const unit = match[2];
|
|
32
|
+
const unitToMilliseconds = {
|
|
33
|
+
s: exports.SECOND * 1000,
|
|
34
|
+
m: exports.MINUTE * 1000,
|
|
35
|
+
h: exports.HOUR * 1000,
|
|
36
|
+
d: exports.DAY * 1000,
|
|
37
|
+
w: exports.WEEK * 1000,
|
|
38
|
+
};
|
|
39
|
+
const milliseconds = unitToMilliseconds[unit];
|
|
40
|
+
return value * milliseconds;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/shared/utils/time.ts"],"names":[],"mappings":";;;;;;AAUA,0CAGC;AAED,oCAGC;AAED,8DAiBC;AArCD,8DAA8C;AAEjC,QAAA,MAAM,GAAG,CAAC,CAAA;AACV,QAAA,MAAM,GAAG,cAAM,GAAG,EAAE,CAAA;AACpB,QAAA,IAAI,GAAG,cAAM,GAAG,EAAE,CAAA;AAClB,QAAA,GAAG,GAAG,YAAI,GAAG,EAAE,CAAA;AACf,QAAA,IAAI,GAAG,WAAG,GAAG,CAAC,CAAA;AACd,QAAA,KAAK,GAAG,WAAG,GAAG,EAAE,CAAA;AAChB,QAAA,IAAI,GAAG,aAAK,GAAG,EAAE,CAAA;AAE9B,SAAgB,eAAe,CAAC,UAAkB;IAChD,MAAM,QAAQ,GAAG,qBAAoB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACvD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAA;A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