@jaypie/testkit 1.2.41 → 1.2.43
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/mock/aws.d.ts +24 -6
- package/dist/mock/core.d.ts +68 -17
- package/dist/mock/datadog.d.ts +22 -4
- package/dist/mock/express.d.ts +60 -15
- package/dist/mock/index.d.ts +227 -58
- package/dist/mock/index.js +31 -12
- package/dist/mock/index.js.map +1 -1
- package/dist/mock/kit.d.ts +12 -3
- package/dist/mock/llm.d.ts +12 -3
- package/dist/mock/logger.d.ts +7 -4
- package/dist/mock/mock/aws.d.ts +24 -6
- package/dist/mock/mock/core.d.ts +68 -17
- package/dist/mock/mock/datadog.d.ts +22 -4
- package/dist/mock/mock/express.d.ts +60 -15
- package/dist/mock/mock/kit.d.ts +12 -3
- package/dist/mock/mock/llm.d.ts +12 -3
- package/dist/mock/mock/logger.d.ts +7 -4
- package/dist/mock/mock/mongoose.d.ts +12 -3
- package/dist/mock/mock/textract.d.ts +8 -2
- package/dist/mock/mock/tildeskill.d.ts +4 -1
- package/dist/mock/mock/utils.d.ts +5 -4
- package/dist/mock/mongoose.d.ts +12 -3
- package/dist/mock/textract.d.ts +8 -2
- package/dist/mock/tildeskill.d.ts +4 -1
- package/dist/mock/utils.d.ts +5 -4
- package/package.json +2 -2
package/dist/mock/index.d.ts
CHANGED
|
@@ -7,29 +7,48 @@ import * as original from '@jaypie/dynamodb';
|
|
|
7
7
|
import { ParentReference, ScanTableOptions, StorableEntity, CreateTableOptions, CreateTableResult, ExportResult, DynamoClientConfig, QueryResult, SeedOptions, SeedResult } from '@jaypie/dynamodb';
|
|
8
8
|
export { BaseQueryOptions, CreateTableOptions, CreateTableResult, ExportResult, ParentReference, QueryParams, QueryResult, ScanTableOptions, SeedOptions, SeedResult, StorableEntity } from '@jaypie/dynamodb';
|
|
9
9
|
import * as original$1 from '@jaypie/express';
|
|
10
|
+
import * as _vitest_spy from '@vitest/spy';
|
|
10
11
|
import * as original$2 from '@jaypie/llm';
|
|
11
12
|
export { FORMAT, LEVEL, Logger, log, redactAuth, sanitizeAuth } from '@jaypie/logger';
|
|
12
13
|
export { IndexableModel } from '@jaypie/fabric';
|
|
13
14
|
export { mongoose } from '@jaypie/mongoose';
|
|
14
15
|
|
|
15
|
-
declare const getMessages: vitest.
|
|
16
|
+
declare const getMessages: vitest.MockInstance<(...args: any[]) => any> & {
|
|
17
|
+
(...args: any[]): any;
|
|
18
|
+
new (...args: any[]): any;
|
|
19
|
+
} & {};
|
|
16
20
|
declare const getS3FileBuffer: (({ bucket, key }: {
|
|
17
21
|
bucket: string;
|
|
18
22
|
key: string;
|
|
19
23
|
}) => Promise<Buffer>) & {
|
|
20
24
|
mock: any;
|
|
21
25
|
};
|
|
22
|
-
declare const getSecret: vitest.
|
|
23
|
-
|
|
26
|
+
declare const getSecret: vitest.MockInstance<(...args: any[]) => any> & {
|
|
27
|
+
(...args: any[]): any;
|
|
28
|
+
new (...args: any[]): any;
|
|
29
|
+
} & {};
|
|
30
|
+
declare const sendMessage: vitest.MockInstance<(...args: any[]) => any> & {
|
|
31
|
+
(...args: any[]): any;
|
|
32
|
+
new (...args: any[]): any;
|
|
33
|
+
} & {};
|
|
24
34
|
declare const getEnvSecret: ((key: string) => Promise<string>) & {
|
|
25
35
|
mock: any;
|
|
26
36
|
};
|
|
27
|
-
declare const loadEnvSecrets: vitest.
|
|
28
|
-
|
|
37
|
+
declare const loadEnvSecrets: vitest.MockInstance<(...args: any[]) => any> & {
|
|
38
|
+
(...args: any[]): any;
|
|
39
|
+
new (...args: any[]): any;
|
|
40
|
+
} & {};
|
|
41
|
+
declare const getSingletonMessage: vitest.MockInstance<(...args: any[]) => any> & {
|
|
42
|
+
(...args: any[]): any;
|
|
43
|
+
new (...args: any[]): any;
|
|
44
|
+
} & {};
|
|
29
45
|
declare const getTextractJob: ((jobId: string) => Promise<any>) & {
|
|
30
46
|
mock: any;
|
|
31
47
|
};
|
|
32
|
-
declare const sendBatchMessages: vitest.
|
|
48
|
+
declare const sendBatchMessages: vitest.MockInstance<(...args: any[]) => any> & {
|
|
49
|
+
(...args: any[]): any;
|
|
50
|
+
new (...args: any[]): any;
|
|
51
|
+
} & {};
|
|
33
52
|
declare const sendTextractJob: (({ bucket, key, featureTypes, }: {
|
|
34
53
|
bucket: string;
|
|
35
54
|
key: string;
|
|
@@ -149,26 +168,68 @@ declare const UnavailableError: typeof errors.UnavailableError;
|
|
|
149
168
|
declare const UnhandledError: typeof errors.UnhandledError;
|
|
150
169
|
declare const UnreachableCodeError: typeof errors.UnreachableCodeError;
|
|
151
170
|
|
|
152
|
-
declare const cloneDeep: vitest.
|
|
153
|
-
|
|
154
|
-
|
|
171
|
+
declare const cloneDeep: vitest.MockInstance<(...args: any[]) => any> & {
|
|
172
|
+
(...args: any[]): any;
|
|
173
|
+
new (...args: any[]): any;
|
|
174
|
+
} & {};
|
|
175
|
+
declare const envBoolean: vitest.MockInstance<(...args: any[]) => any> & {
|
|
176
|
+
(...args: any[]): any;
|
|
177
|
+
new (...args: any[]): any;
|
|
178
|
+
} & {};
|
|
179
|
+
declare const envsKey: vitest.MockInstance<(...args: any[]) => any> & {
|
|
180
|
+
(...args: any[]): any;
|
|
181
|
+
new (...args: any[]): any;
|
|
182
|
+
} & {};
|
|
155
183
|
declare const errorFromStatusCode: ((statusCode: number, message?: string) => Error) & {
|
|
156
184
|
mock: any;
|
|
157
185
|
};
|
|
158
|
-
declare const formatError: vitest.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
186
|
+
declare const formatError: vitest.MockInstance<(...args: any[]) => any> & {
|
|
187
|
+
(...args: any[]): any;
|
|
188
|
+
new (...args: any[]): any;
|
|
189
|
+
} & {};
|
|
190
|
+
declare const generateJaypieKey: vitest.MockInstance<(...args: any[]) => any> & {
|
|
191
|
+
(...args: any[]): any;
|
|
192
|
+
new (...args: any[]): any;
|
|
193
|
+
} & {};
|
|
194
|
+
declare const hashJaypieKey: vitest.MockInstance<(...args: any[]) => any> & {
|
|
195
|
+
(...args: any[]): any;
|
|
196
|
+
new (...args: any[]): any;
|
|
197
|
+
} & {};
|
|
198
|
+
declare const jaypieApiKeyId: vitest.MockInstance<(...args: any[]) => any> & {
|
|
199
|
+
(...args: any[]): any;
|
|
200
|
+
new (...args: any[]): any;
|
|
201
|
+
} & {};
|
|
162
202
|
declare const jaypieErrorFromStatus: ((statusCode: number, message?: string) => Error) & {
|
|
163
203
|
mock: any;
|
|
164
204
|
};
|
|
165
|
-
declare const getHeaderFrom: vitest.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
declare const
|
|
170
|
-
|
|
171
|
-
|
|
205
|
+
declare const getHeaderFrom: vitest.MockInstance<(...args: any[]) => any> & {
|
|
206
|
+
(...args: any[]): any;
|
|
207
|
+
new (...args: any[]): any;
|
|
208
|
+
} & {};
|
|
209
|
+
declare const getObjectKeyCaseInsensitive: vitest.MockInstance<(...args: any[]) => any> & {
|
|
210
|
+
(...args: any[]): any;
|
|
211
|
+
new (...args: any[]): any;
|
|
212
|
+
} & {};
|
|
213
|
+
declare const isClass: vitest.MockInstance<(...args: any[]) => any> & {
|
|
214
|
+
(...args: any[]): any;
|
|
215
|
+
new (...args: any[]): any;
|
|
216
|
+
} & {};
|
|
217
|
+
declare const isJaypieError: vitest.MockInstance<(...args: any[]) => any> & {
|
|
218
|
+
(...args: any[]): any;
|
|
219
|
+
new (...args: any[]): any;
|
|
220
|
+
} & {};
|
|
221
|
+
declare const resolveValue: vitest.MockInstance<(...args: any[]) => any> & {
|
|
222
|
+
(...args: any[]): any;
|
|
223
|
+
new (...args: any[]): any;
|
|
224
|
+
} & {};
|
|
225
|
+
declare const safeParseFloat: vitest.MockInstance<(...args: any[]) => any> & {
|
|
226
|
+
(...args: any[]): any;
|
|
227
|
+
new (...args: any[]): any;
|
|
228
|
+
} & {};
|
|
229
|
+
declare const placeholders: vitest.MockInstance<(...args: any[]) => any> & {
|
|
230
|
+
(...args: any[]): any;
|
|
231
|
+
new (...args: any[]): any;
|
|
232
|
+
} & {};
|
|
172
233
|
declare const force: kit.ForceFunction;
|
|
173
234
|
declare const jaypieHandler: ((handler: Function, options?: {
|
|
174
235
|
setup?: Function | Function[];
|
|
@@ -178,9 +239,18 @@ declare const jaypieHandler: ((handler: Function, options?: {
|
|
|
178
239
|
}) => Function) & {
|
|
179
240
|
mock: any;
|
|
180
241
|
};
|
|
181
|
-
declare const sleep: vitest.
|
|
182
|
-
|
|
183
|
-
|
|
242
|
+
declare const sleep: vitest.MockInstance<(...args: any[]) => any> & {
|
|
243
|
+
(...args: any[]): any;
|
|
244
|
+
new (...args: any[]): any;
|
|
245
|
+
} & {};
|
|
246
|
+
declare const uuid: vitest.MockInstance<(...args: any[]) => any> & {
|
|
247
|
+
(...args: any[]): any;
|
|
248
|
+
new (...args: any[]): any;
|
|
249
|
+
} & {};
|
|
250
|
+
declare const validateJaypieKey: vitest.MockInstance<(...args: any[]) => any> & {
|
|
251
|
+
(...args: any[]): any;
|
|
252
|
+
new (...args: any[]): any;
|
|
253
|
+
} & {};
|
|
184
254
|
declare const HTTP: {
|
|
185
255
|
readonly ALLOW: {
|
|
186
256
|
readonly ANY: "*";
|
|
@@ -348,7 +418,9 @@ declare const DATADOG: {
|
|
|
348
418
|
ENV: {
|
|
349
419
|
DATADOG_API_KEY: string;
|
|
350
420
|
DATADOG_API_KEY_ARN: string;
|
|
421
|
+
DD_API_KEY: string;
|
|
351
422
|
DD_API_KEY_SECRET_ARN: string;
|
|
423
|
+
DD_LLMOBS_ENABLED: string;
|
|
352
424
|
DD_SITE: string;
|
|
353
425
|
SECRET_DATADOG_API_KEY: string;
|
|
354
426
|
};
|
|
@@ -362,10 +434,26 @@ declare const DATADOG: {
|
|
|
362
434
|
};
|
|
363
435
|
SITE: string;
|
|
364
436
|
};
|
|
365
|
-
declare const hasDatadogEnv: vitest.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
437
|
+
declare const hasDatadogEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
438
|
+
(...args: any[]): any;
|
|
439
|
+
new (...args: any[]): any;
|
|
440
|
+
} & {};
|
|
441
|
+
declare const loadDatadogApiKey: vitest.MockInstance<(...args: any[]) => any> & {
|
|
442
|
+
(...args: any[]): any;
|
|
443
|
+
new (...args: any[]): any;
|
|
444
|
+
} & {};
|
|
445
|
+
declare const submitDistribution: vitest.MockInstance<(...args: any[]) => any> & {
|
|
446
|
+
(...args: any[]): any;
|
|
447
|
+
new (...args: any[]): any;
|
|
448
|
+
} & {};
|
|
449
|
+
declare const submitMetric: vitest.MockInstance<(...args: any[]) => any> & {
|
|
450
|
+
(...args: any[]): any;
|
|
451
|
+
new (...args: any[]): any;
|
|
452
|
+
} & {};
|
|
453
|
+
declare const submitMetricSet: vitest.MockInstance<(...args: any[]) => any> & {
|
|
454
|
+
(...args: any[]): any;
|
|
455
|
+
new (...args: any[]): any;
|
|
456
|
+
} & {};
|
|
369
457
|
|
|
370
458
|
declare const APEX = "@";
|
|
371
459
|
declare const ARCHIVED_SUFFIX = "#archived";
|
|
@@ -532,9 +620,18 @@ declare const destroyTable: ((params: {
|
|
|
532
620
|
mock: any;
|
|
533
621
|
};
|
|
534
622
|
|
|
535
|
-
declare const createLambdaHandler: vitest.
|
|
536
|
-
|
|
537
|
-
|
|
623
|
+
declare const createLambdaHandler: vitest.MockInstance<(...args: any[]) => any> & {
|
|
624
|
+
(...args: any[]): any;
|
|
625
|
+
new (...args: any[]): any;
|
|
626
|
+
} & {};
|
|
627
|
+
declare const createLambdaStreamHandler: vitest.MockInstance<(...args: any[]) => any> & {
|
|
628
|
+
(...args: any[]): any;
|
|
629
|
+
new (...args: any[]): any;
|
|
630
|
+
} & {};
|
|
631
|
+
declare const getCurrentInvoke: vitest.MockInstance<(...args: any[]) => any> & {
|
|
632
|
+
(...args: any[]): any;
|
|
633
|
+
new (...args: any[]): any;
|
|
634
|
+
} & {};
|
|
538
635
|
declare const LambdaRequest: typeof original$1.LambdaRequest;
|
|
539
636
|
declare const LambdaResponseBuffered: typeof original$1.LambdaResponseBuffered;
|
|
540
637
|
declare const LambdaResponseStreaming: typeof original$1.LambdaResponseStreaming;
|
|
@@ -545,18 +642,54 @@ declare const EXPRESS: {
|
|
|
545
642
|
readonly ROOT: RegExp;
|
|
546
643
|
};
|
|
547
644
|
};
|
|
548
|
-
declare const badRequestRoute: vitest.
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
declare const
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
declare const
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
645
|
+
declare const badRequestRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
646
|
+
(...args: any[]): any;
|
|
647
|
+
new (...args: any[]): any;
|
|
648
|
+
} & {};
|
|
649
|
+
declare const echoRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
650
|
+
(...args: any[]): any;
|
|
651
|
+
new (...args: any[]): any;
|
|
652
|
+
} & {};
|
|
653
|
+
declare const forbiddenRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
654
|
+
(...args: any[]): any;
|
|
655
|
+
new (...args: any[]): any;
|
|
656
|
+
} & {};
|
|
657
|
+
declare const goneRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
658
|
+
(...args: any[]): any;
|
|
659
|
+
new (...args: any[]): any;
|
|
660
|
+
} & {};
|
|
661
|
+
declare const methodNotAllowedRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
662
|
+
(...args: any[]): any;
|
|
663
|
+
new (...args: any[]): any;
|
|
664
|
+
} & {};
|
|
665
|
+
declare const noContentRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
666
|
+
(...args: any[]): any;
|
|
667
|
+
new (...args: any[]): any;
|
|
668
|
+
} & {};
|
|
669
|
+
declare const notFoundRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
670
|
+
(...args: any[]): any;
|
|
671
|
+
new (...args: any[]): any;
|
|
672
|
+
} & {};
|
|
673
|
+
declare const notImplementedRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
674
|
+
(...args: any[]): any;
|
|
675
|
+
new (...args: any[]): any;
|
|
676
|
+
} & {};
|
|
677
|
+
declare const expressHttpCodeHandler: vitest.MockInstance<(...args: any[]) => any> & {
|
|
678
|
+
(...args: any[]): any;
|
|
679
|
+
new (...args: any[]): any;
|
|
680
|
+
} & {};
|
|
681
|
+
declare const cors: vitest.MockInstance<(...args: any[]) => any> & {
|
|
682
|
+
(...args: any[]): any;
|
|
683
|
+
new (...args: any[]): any;
|
|
684
|
+
} & {};
|
|
685
|
+
declare const fabricApiResponse: vitest.MockInstance<(...args: any[]) => any> & {
|
|
686
|
+
(...args: any[]): any;
|
|
687
|
+
new (...args: any[]): any;
|
|
688
|
+
} & {};
|
|
689
|
+
declare const getCurrentInvokeUuid: vitest.MockInstance<(...args: any[]) => any> & {
|
|
690
|
+
(...args: any[]): any;
|
|
691
|
+
new (...args: any[]): any;
|
|
692
|
+
} & {};
|
|
560
693
|
interface ExpressHandlerFunction {
|
|
561
694
|
(req: any, res: any, ...extra: any[]): Promise<any> | any;
|
|
562
695
|
}
|
|
@@ -585,9 +718,18 @@ declare const expressHandler: ((handlerOrProps: ExpressHandlerParameter, propsOr
|
|
|
585
718
|
mock: any;
|
|
586
719
|
};
|
|
587
720
|
|
|
588
|
-
declare const isLocalEnv: vitest.
|
|
589
|
-
|
|
590
|
-
|
|
721
|
+
declare const isLocalEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
722
|
+
(...args: any[]): any;
|
|
723
|
+
new (...args: any[]): any;
|
|
724
|
+
} & {};
|
|
725
|
+
declare const isNodeTestEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
726
|
+
(...args: any[]): any;
|
|
727
|
+
new (...args: any[]): any;
|
|
728
|
+
} & {};
|
|
729
|
+
declare const isProductionEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
730
|
+
(...args: any[]): any;
|
|
731
|
+
new (...args: any[]): any;
|
|
732
|
+
} & {};
|
|
591
733
|
|
|
592
734
|
type HandlerFunction = (...args: unknown[]) => unknown;
|
|
593
735
|
type LifecycleFunction = (...args: unknown[]) => unknown | Promise<unknown>;
|
|
@@ -640,9 +782,18 @@ declare const websocketHandler: ((handler: WebSocketHandlerFunction, props?: Lam
|
|
|
640
782
|
};
|
|
641
783
|
|
|
642
784
|
declare const LLM: typeof original$2.LLM;
|
|
643
|
-
declare const Llm: vitest.
|
|
644
|
-
|
|
645
|
-
|
|
785
|
+
declare const Llm: vitest.MockInstance<_vitest_spy.Procedure> & {
|
|
786
|
+
(...args: any[]): any;
|
|
787
|
+
new (...args: any[]): any;
|
|
788
|
+
} & {} & {
|
|
789
|
+
operate: vitest.MockInstance<(...args: any[]) => any> & {
|
|
790
|
+
(...args: any[]): any;
|
|
791
|
+
new (...args: any[]): any;
|
|
792
|
+
} & {};
|
|
793
|
+
send: vitest.MockInstance<(...args: any[]) => any> & {
|
|
794
|
+
(...args: any[]): any;
|
|
795
|
+
new (...args: any[]): any;
|
|
796
|
+
} & {};
|
|
646
797
|
};
|
|
647
798
|
declare const Toolkit: typeof original$2.Toolkit;
|
|
648
799
|
declare const JaypieToolkit: typeof original$2.JaypieToolkit;
|
|
@@ -729,14 +880,26 @@ declare module "vitest" {
|
|
|
729
880
|
}
|
|
730
881
|
}
|
|
731
882
|
|
|
732
|
-
declare const createLogger: vitest.
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
883
|
+
declare const createLogger: vitest.MockInstance<(...args: any[]) => any> & {
|
|
884
|
+
(...args: any[]): any;
|
|
885
|
+
new (...args: any[]): any;
|
|
886
|
+
} & {};
|
|
887
|
+
declare const _resetDatadogTransport: vitest.Mock<_vitest_spy.Procedure>;
|
|
888
|
+
declare const getDatadogTransport: vitest.Mock<_vitest_spy.Procedure>;
|
|
889
|
+
declare const isDatadogForwardingEnabled: vitest.Mock<_vitest_spy.Procedure>;
|
|
736
890
|
|
|
737
|
-
declare const connect: vitest.
|
|
738
|
-
|
|
739
|
-
|
|
891
|
+
declare const connect: vitest.MockInstance<(...args: any[]) => any> & {
|
|
892
|
+
(...args: any[]): any;
|
|
893
|
+
new (...args: any[]): any;
|
|
894
|
+
} & {};
|
|
895
|
+
declare const connectFromSecretEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
896
|
+
(...args: any[]): any;
|
|
897
|
+
new (...args: any[]): any;
|
|
898
|
+
} & {};
|
|
899
|
+
declare const disconnect: vitest.MockInstance<(...args: any[]) => any> & {
|
|
900
|
+
(...args: any[]): any;
|
|
901
|
+
new (...args: any[]): any;
|
|
902
|
+
} & {};
|
|
740
903
|
|
|
741
904
|
/**
|
|
742
905
|
* Mock for MarkdownPage class from @jaypie/textract
|
|
@@ -745,12 +908,18 @@ declare const MarkdownPage: any;
|
|
|
745
908
|
/**
|
|
746
909
|
* Mock for textractJsonToMarkdown function from @jaypie/textract
|
|
747
910
|
*/
|
|
748
|
-
declare const textractJsonToMarkdown: vitest.
|
|
911
|
+
declare const textractJsonToMarkdown: vitest.MockInstance<(...args: any[]) => any> & {
|
|
912
|
+
(...args: any[]): any;
|
|
913
|
+
new (...args: any[]): any;
|
|
914
|
+
} & {};
|
|
749
915
|
|
|
750
916
|
declare const expandIncludes: ((...args: any[]) => any) & {
|
|
751
917
|
mock: any;
|
|
752
918
|
};
|
|
753
|
-
declare const isValidAlias: vitest.
|
|
919
|
+
declare const isValidAlias: vitest.MockInstance<(...args: any[]) => any> & {
|
|
920
|
+
(...args: any[]): any;
|
|
921
|
+
new (...args: any[]): any;
|
|
922
|
+
} & {};
|
|
754
923
|
declare const getAlternativeSpellings: ((...args: any[]) => any) & {
|
|
755
924
|
mock: any;
|
|
756
925
|
};
|
|
@@ -778,5 +947,5 @@ declare const createMemoryStore: ((...args: any[]) => any) & {
|
|
|
778
947
|
|
|
779
948
|
declare const mock: Record<string, any>;
|
|
780
949
|
|
|
781
|
-
export { APEX, ARCHIVED_SUFFIX, BadGatewayError, BadRequestError, BedrockProvider, ConfigurationError, ConflictError, CorsError, DATADOG, DELETED_SUFFIX, EXPRESS, ForbiddenError, GatewayTimeoutError, GeminiProvider, GoneError, GoogleProvider, HTTP, IllogicalError, InternalError, JAYPIE, JaypieError, JaypieStream, JaypieToolkit, LLM, LambdaRequest, LambdaResponseBuffered, LambdaResponseStreaming, Llm, LlmMessageRole, LlmMessageType, LlmStreamChunkType, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, OpenRouterProvider, PROJECT, ProjectError, ProjectMultiError, RejectedError, SEPARATOR, TeapotError, TooManyRequestsError, Toolkit, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, XaiProvider, _resetDatadogTransport, archiveEntity, badRequestRoute, broadcastToConnections, buildCompositeKey, calculateScope, clearWebSocketClientCache, cloneDeep, connect, connectFromSecretEnv, cors, countTable, createEntity, createExpressStream, createJaypieStream, createLambdaHandler, createLambdaStream, createLambdaStreamHandler, createLayeredStore, createLogger, createMarkdownStore, createMemoryStore, createSkillService, createTable, mock as default, deleteEntity, destroyEntity, destroyTable, disconnect, echoRoute, envBoolean, envsKey, errorFromStatusCode, expandIncludes, exportEntities, exportEntitiesToJson, expressHandler, expressHttpCodeHandler, expressStreamHandler, extractReasoning, fabricApiResponse, forbiddenRoute, force, formatError, formatNljson, formatSse, formatStreamError, formatStreamErrorNljson, formatStreamErrorSse, generateJaypieKey, getAlternativeSpellings, getClient, getContentTypeForFormat, getCurrentInvoke, getCurrentInvokeUuid, getDatadogTransport, getDocClient, getEntity, getEnvSecret, getHeaderFrom, getMessages, getObjectKeyCaseInsensitive, getS3FileBuffer, getSecret, getSingletonMessage, getTableName, getTextractJob, goneRoute, hasDatadogEnv, hashJaypieKey, indexEntity, initClient, isClass, isDatadogForwardingEnabled, isInitialized, isJaypieError, isLlmOperateInput, isLlmOperateInputContent, isLlmOperateInputFile, isLlmOperateInputImage, isLocalEnv, isNodeTestEnv, isProductionEnv, isValidAlias, jaypieApiKeyId, jaypieErrorFromStatus, jaypieHandler, lambdaHandler, lambdaStreamHandler, loadEnvSecrets, methodNotAllowedRoute, migrationHandler, noContentRoute, normalizeAlias, notFoundRoute, notImplementedRoute, parseList, placeholders, query, queryByAlias, queryByCategory, queryByScope, queryByType, queryByXid, resetClient, resolveValue, safeParseFloat, scanTable, seedEntities, seedEntityIfNotExists, sendBatchMessages, sendMessage, sendTextractJob, sendToConnection, sleep, streamToSse, submitDistribution, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, transactWriteEntities, updateEntity, uuid, validateAlias, validateJaypieKey, websocketHandler };
|
|
950
|
+
export { APEX, ARCHIVED_SUFFIX, BadGatewayError, BadRequestError, BedrockProvider, ConfigurationError, ConflictError, CorsError, DATADOG, DELETED_SUFFIX, EXPRESS, ForbiddenError, GatewayTimeoutError, GeminiProvider, GoneError, GoogleProvider, HTTP, IllogicalError, InternalError, JAYPIE, JaypieError, JaypieStream, JaypieToolkit, LLM, LambdaRequest, LambdaResponseBuffered, LambdaResponseStreaming, Llm, LlmMessageRole, LlmMessageType, LlmStreamChunkType, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, OpenRouterProvider, PROJECT, ProjectError, ProjectMultiError, RejectedError, SEPARATOR, TeapotError, TooManyRequestsError, Toolkit, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, XaiProvider, _resetDatadogTransport, archiveEntity, badRequestRoute, broadcastToConnections, buildCompositeKey, calculateScope, clearWebSocketClientCache, cloneDeep, connect, connectFromSecretEnv, cors, countTable, createEntity, createExpressStream, createJaypieStream, createLambdaHandler, createLambdaStream, createLambdaStreamHandler, createLayeredStore, createLogger, createMarkdownStore, createMemoryStore, createSkillService, createTable, mock as default, deleteEntity, destroyEntity, destroyTable, disconnect, echoRoute, envBoolean, envsKey, errorFromStatusCode, expandIncludes, exportEntities, exportEntitiesToJson, expressHandler, expressHttpCodeHandler, expressStreamHandler, extractReasoning, fabricApiResponse, forbiddenRoute, force, formatError, formatNljson, formatSse, formatStreamError, formatStreamErrorNljson, formatStreamErrorSse, generateJaypieKey, getAlternativeSpellings, getClient, getContentTypeForFormat, getCurrentInvoke, getCurrentInvokeUuid, getDatadogTransport, getDocClient, getEntity, getEnvSecret, getHeaderFrom, getMessages, getObjectKeyCaseInsensitive, getS3FileBuffer, getSecret, getSingletonMessage, getTableName, getTextractJob, goneRoute, hasDatadogEnv, hashJaypieKey, indexEntity, initClient, isClass, isDatadogForwardingEnabled, isInitialized, isJaypieError, isLlmOperateInput, isLlmOperateInputContent, isLlmOperateInputFile, isLlmOperateInputImage, isLocalEnv, isNodeTestEnv, isProductionEnv, isValidAlias, jaypieApiKeyId, jaypieErrorFromStatus, jaypieHandler, lambdaHandler, lambdaStreamHandler, loadDatadogApiKey, loadEnvSecrets, methodNotAllowedRoute, migrationHandler, noContentRoute, normalizeAlias, notFoundRoute, notImplementedRoute, parseList, placeholders, query, queryByAlias, queryByCategory, queryByScope, queryByType, queryByXid, resetClient, resolveValue, safeParseFloat, scanTable, seedEntities, seedEntityIfNotExists, sendBatchMessages, sendMessage, sendTextractJob, sendToConnection, sleep, streamToSse, submitDistribution, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, transactWriteEntities, updateEntity, uuid, validateAlias, validateJaypieKey, websocketHandler };
|
|
782
951
|
export type { ExpressHandlerFunction, ExpressHandlerOptions, ExpressStreamHandlerFunction, ExpressStreamHandlerOptions, LambdaOptions, WebSocketContext, WebSocketResponse };
|
package/dist/mock/index.js
CHANGED
|
@@ -17,7 +17,6 @@ import { fileURLToPath } from 'url';
|
|
|
17
17
|
import { TextractDocument } from 'amazon-textract-response-parser';
|
|
18
18
|
import * as original$5 from '@jaypie/textract';
|
|
19
19
|
|
|
20
|
-
/* eslint-disable no-console */
|
|
21
20
|
/**
|
|
22
21
|
* Internal wrapper for vi.fn() that adds _jaypie: true to all mocks
|
|
23
22
|
*/
|
|
@@ -66,9 +65,11 @@ function createMockWrappedFunction(fn, fallbackOrOptions = "_MOCK_WRAPPED_RESULT
|
|
|
66
65
|
const fallback = options.fallback ?? "_MOCK_WRAPPED_RESULT";
|
|
67
66
|
const throws = options.throws ?? false;
|
|
68
67
|
const isClass = options.class ?? false;
|
|
69
|
-
|
|
68
|
+
// Shared behavior for both call and construct: try the real
|
|
69
|
+
// implementation, fall back (with a warning) when it throws.
|
|
70
|
+
const invoke = (instantiate, args) => {
|
|
70
71
|
try {
|
|
71
|
-
return
|
|
72
|
+
return instantiate ? new fn(...args) : fn(...args);
|
|
72
73
|
}
|
|
73
74
|
catch (error) {
|
|
74
75
|
if (throws) {
|
|
@@ -90,7 +91,17 @@ function createMockWrappedFunction(fn, fallbackOrOptions = "_MOCK_WRAPPED_RESULT
|
|
|
90
91
|
}
|
|
91
92
|
return fallback;
|
|
92
93
|
}
|
|
93
|
-
}
|
|
94
|
+
};
|
|
95
|
+
// vitest 4 requires a `class`/`function` implementation when the mock is
|
|
96
|
+
// instantiated with `new`. A plain `function` (not an arrow) can be invoked
|
|
97
|
+
// either with or without `new`; returning an object replaces the instance in
|
|
98
|
+
// both cases, so callers receive the wrapped result (or fallback).
|
|
99
|
+
if (isClass) {
|
|
100
|
+
return _createJaypieMock().mockImplementation(function (...args) {
|
|
101
|
+
return invoke(true, args);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return _createJaypieMock().mockImplementation((...args) => invoke(false, args));
|
|
94
105
|
}
|
|
95
106
|
function createMockWrappedObject(object, fallbackOrOptions = "_MOCK_WRAPPED_RESULT") {
|
|
96
107
|
let returnMock = {};
|
|
@@ -635,6 +646,7 @@ var core = /*#__PURE__*/Object.freeze({
|
|
|
635
646
|
|
|
636
647
|
const DATADOG = original$1.DATADOG;
|
|
637
648
|
const hasDatadogEnv = createMockWrappedFunction(original$1.hasDatadogEnv, false);
|
|
649
|
+
const loadDatadogApiKey = createMockResolvedFunction(false);
|
|
638
650
|
const submitDistribution = createMockResolvedFunction(true);
|
|
639
651
|
const submitMetric = createMockResolvedFunction(true);
|
|
640
652
|
const submitMetricSet = createMockResolvedFunction(true);
|
|
@@ -643,6 +655,7 @@ var datadog = /*#__PURE__*/Object.freeze({
|
|
|
643
655
|
__proto__: null,
|
|
644
656
|
DATADOG: DATADOG,
|
|
645
657
|
hasDatadogEnv: hasDatadogEnv,
|
|
658
|
+
loadDatadogApiKey: loadDatadogApiKey,
|
|
646
659
|
submitDistribution: submitDistribution,
|
|
647
660
|
submitMetric: submitMetric,
|
|
648
661
|
submitMetricSet: submitMetricSet
|
|
@@ -1135,15 +1148,21 @@ const mockOperate = createMockResolvedFunction({
|
|
|
1135
1148
|
],
|
|
1136
1149
|
});
|
|
1137
1150
|
const mockSend = createMockResolvedFunction("_MOCK_LLM_RESPONSE");
|
|
1138
|
-
const Llm = Object.assign(
|
|
1139
|
-
|
|
1140
|
-
|
|
1151
|
+
const Llm = Object.assign(
|
|
1152
|
+
// vitest 4 requires a constructable (non-arrow) implementation when the mock
|
|
1153
|
+
// is instantiated with `new`. A plain `function` returning an object replaces
|
|
1154
|
+
// the instance, preserving the previous mock shape.
|
|
1155
|
+
vi.fn().mockImplementation(function (providerName = "_MOCK_LLM_PROVIDER") {
|
|
1156
|
+
return {
|
|
1157
|
+
_provider: providerName,
|
|
1158
|
+
_llm: {
|
|
1159
|
+
operate: mockOperate,
|
|
1160
|
+
send: mockSend,
|
|
1161
|
+
},
|
|
1141
1162
|
operate: mockOperate,
|
|
1142
1163
|
send: mockSend,
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
send: mockSend,
|
|
1146
|
-
})), {
|
|
1164
|
+
};
|
|
1165
|
+
}), {
|
|
1147
1166
|
operate: mockOperate,
|
|
1148
1167
|
send: mockSend,
|
|
1149
1168
|
});
|
|
@@ -1390,5 +1409,5 @@ const mock = {
|
|
|
1390
1409
|
...tildeskill,
|
|
1391
1410
|
};
|
|
1392
1411
|
|
|
1393
|
-
export { APEX, ARCHIVED_SUFFIX, BadGatewayError, BadRequestError, BedrockProvider, ConfigurationError, ConflictError, CorsError, DATADOG, DELETED_SUFFIX, EXPRESS, ForbiddenError, GatewayTimeoutError, GeminiProvider, GoneError, GoogleProvider, HTTP$1 as HTTP, IllogicalError, InternalError, JAYPIE, JaypieError, JaypieStream, JaypieToolkit, LLM, LambdaRequest, LambdaResponseBuffered, LambdaResponseStreaming, Llm, LlmMessageRole, LlmMessageType, LlmStreamChunkType, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, OpenRouterProvider, PROJECT, ProjectError, ProjectMultiError, RejectedError, SEPARATOR, TeapotError, TooManyRequestsError, Toolkit, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, XaiProvider, _resetDatadogTransport, archiveEntity, badRequestRoute, broadcastToConnections, buildCompositeKey, calculateScope, clearWebSocketClientCache, cloneDeep, connect, connectFromSecretEnv, cors, countTable, createEntity, createExpressStream, createJaypieStream, createLambdaHandler, createLambdaStream, createLambdaStreamHandler, createLayeredStore, createLogger, createMarkdownStore, createMemoryStore, createSkillService, createTable, mock as default, deleteEntity, destroyEntity, destroyTable, disconnect, echoRoute, envBoolean, envsKey, errorFromStatusCode, expandIncludes, exportEntities, exportEntitiesToJson, expressHandler, expressHttpCodeHandler, expressStreamHandler, extractReasoning, fabricApiResponse, forbiddenRoute, force, formatError, formatNljson, formatSse, formatStreamError, formatStreamErrorNljson, formatStreamErrorSse, generateJaypieKey, getAlternativeSpellings, getClient, getContentTypeForFormat, getCurrentInvoke, getCurrentInvokeUuid, getDatadogTransport, getDocClient, getEntity, getEnvSecret, getHeaderFrom, getMessages, getObjectKeyCaseInsensitive, getS3FileBuffer, getSecret, getSingletonMessage, getTableName, getTextractJob, goneRoute, hasDatadogEnv, hashJaypieKey, indexEntity, initClient, isClass, isDatadogForwardingEnabled, isInitialized, isJaypieError, isLlmOperateInput, isLlmOperateInputContent, isLlmOperateInputFile, isLlmOperateInputImage, isLocalEnv, isNodeTestEnv, isProductionEnv, isValidAlias, jaypieApiKeyId, jaypieErrorFromStatus, jaypieHandler, lambdaHandler, lambdaStreamHandler, loadEnvSecrets, methodNotAllowedRoute, migrationHandler, noContentRoute, normalizeAlias, notFoundRoute, notImplementedRoute, parseList, placeholders, query, queryByAlias, queryByCategory, queryByScope, queryByType, queryByXid, resetClient, resolveValue, safeParseFloat, scanTable, seedEntities, seedEntityIfNotExists, sendBatchMessages, sendMessage, sendTextractJob, sendToConnection, sleep, streamToSse, submitDistribution, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, transactWriteEntities, updateEntity, uuid, validateAlias, validateJaypieKey, websocketHandler };
|
|
1412
|
+
export { APEX, ARCHIVED_SUFFIX, BadGatewayError, BadRequestError, BedrockProvider, ConfigurationError, ConflictError, CorsError, DATADOG, DELETED_SUFFIX, EXPRESS, ForbiddenError, GatewayTimeoutError, GeminiProvider, GoneError, GoogleProvider, HTTP$1 as HTTP, IllogicalError, InternalError, JAYPIE, JaypieError, JaypieStream, JaypieToolkit, LLM, LambdaRequest, LambdaResponseBuffered, LambdaResponseStreaming, Llm, LlmMessageRole, LlmMessageType, LlmStreamChunkType, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, OpenRouterProvider, PROJECT, ProjectError, ProjectMultiError, RejectedError, SEPARATOR, TeapotError, TooManyRequestsError, Toolkit, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, XaiProvider, _resetDatadogTransport, archiveEntity, badRequestRoute, broadcastToConnections, buildCompositeKey, calculateScope, clearWebSocketClientCache, cloneDeep, connect, connectFromSecretEnv, cors, countTable, createEntity, createExpressStream, createJaypieStream, createLambdaHandler, createLambdaStream, createLambdaStreamHandler, createLayeredStore, createLogger, createMarkdownStore, createMemoryStore, createSkillService, createTable, mock as default, deleteEntity, destroyEntity, destroyTable, disconnect, echoRoute, envBoolean, envsKey, errorFromStatusCode, expandIncludes, exportEntities, exportEntitiesToJson, expressHandler, expressHttpCodeHandler, expressStreamHandler, extractReasoning, fabricApiResponse, forbiddenRoute, force, formatError, formatNljson, formatSse, formatStreamError, formatStreamErrorNljson, formatStreamErrorSse, generateJaypieKey, getAlternativeSpellings, getClient, getContentTypeForFormat, getCurrentInvoke, getCurrentInvokeUuid, getDatadogTransport, getDocClient, getEntity, getEnvSecret, getHeaderFrom, getMessages, getObjectKeyCaseInsensitive, getS3FileBuffer, getSecret, getSingletonMessage, getTableName, getTextractJob, goneRoute, hasDatadogEnv, hashJaypieKey, indexEntity, initClient, isClass, isDatadogForwardingEnabled, isInitialized, isJaypieError, isLlmOperateInput, isLlmOperateInputContent, isLlmOperateInputFile, isLlmOperateInputImage, isLocalEnv, isNodeTestEnv, isProductionEnv, isValidAlias, jaypieApiKeyId, jaypieErrorFromStatus, jaypieHandler, lambdaHandler, lambdaStreamHandler, loadDatadogApiKey, loadEnvSecrets, methodNotAllowedRoute, migrationHandler, noContentRoute, normalizeAlias, notFoundRoute, notImplementedRoute, parseList, placeholders, query, queryByAlias, queryByCategory, queryByScope, queryByType, queryByXid, resetClient, resolveValue, safeParseFloat, scanTable, seedEntities, seedEntityIfNotExists, sendBatchMessages, sendMessage, sendTextractJob, sendToConnection, sleep, streamToSse, submitDistribution, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, transactWriteEntities, updateEntity, uuid, validateAlias, validateJaypieKey, websocketHandler };
|
|
1394
1413
|
//# sourceMappingURL=index.js.map
|