@jaypie/testkit 1.2.40 → 1.2.42
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 +16 -4
- package/dist/mock/express.d.ts +60 -15
- package/dist/mock/index.d.ts +223 -58
- package/dist/mock/index.js +33 -13
- package/dist/mock/index.js.map +1 -1
- package/dist/mock/kit.d.ts +12 -3
- package/dist/mock/llm.d.ts +14 -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 +16 -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 +14 -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: "*";
|
|
@@ -362,10 +432,22 @@ declare const DATADOG: {
|
|
|
362
432
|
};
|
|
363
433
|
SITE: string;
|
|
364
434
|
};
|
|
365
|
-
declare const hasDatadogEnv: vitest.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
435
|
+
declare const hasDatadogEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
436
|
+
(...args: any[]): any;
|
|
437
|
+
new (...args: any[]): any;
|
|
438
|
+
} & {};
|
|
439
|
+
declare const submitDistribution: vitest.MockInstance<(...args: any[]) => any> & {
|
|
440
|
+
(...args: any[]): any;
|
|
441
|
+
new (...args: any[]): any;
|
|
442
|
+
} & {};
|
|
443
|
+
declare const submitMetric: vitest.MockInstance<(...args: any[]) => any> & {
|
|
444
|
+
(...args: any[]): any;
|
|
445
|
+
new (...args: any[]): any;
|
|
446
|
+
} & {};
|
|
447
|
+
declare const submitMetricSet: vitest.MockInstance<(...args: any[]) => any> & {
|
|
448
|
+
(...args: any[]): any;
|
|
449
|
+
new (...args: any[]): any;
|
|
450
|
+
} & {};
|
|
369
451
|
|
|
370
452
|
declare const APEX = "@";
|
|
371
453
|
declare const ARCHIVED_SUFFIX = "#archived";
|
|
@@ -532,9 +614,18 @@ declare const destroyTable: ((params: {
|
|
|
532
614
|
mock: any;
|
|
533
615
|
};
|
|
534
616
|
|
|
535
|
-
declare const createLambdaHandler: vitest.
|
|
536
|
-
|
|
537
|
-
|
|
617
|
+
declare const createLambdaHandler: vitest.MockInstance<(...args: any[]) => any> & {
|
|
618
|
+
(...args: any[]): any;
|
|
619
|
+
new (...args: any[]): any;
|
|
620
|
+
} & {};
|
|
621
|
+
declare const createLambdaStreamHandler: vitest.MockInstance<(...args: any[]) => any> & {
|
|
622
|
+
(...args: any[]): any;
|
|
623
|
+
new (...args: any[]): any;
|
|
624
|
+
} & {};
|
|
625
|
+
declare const getCurrentInvoke: vitest.MockInstance<(...args: any[]) => any> & {
|
|
626
|
+
(...args: any[]): any;
|
|
627
|
+
new (...args: any[]): any;
|
|
628
|
+
} & {};
|
|
538
629
|
declare const LambdaRequest: typeof original$1.LambdaRequest;
|
|
539
630
|
declare const LambdaResponseBuffered: typeof original$1.LambdaResponseBuffered;
|
|
540
631
|
declare const LambdaResponseStreaming: typeof original$1.LambdaResponseStreaming;
|
|
@@ -545,18 +636,54 @@ declare const EXPRESS: {
|
|
|
545
636
|
readonly ROOT: RegExp;
|
|
546
637
|
};
|
|
547
638
|
};
|
|
548
|
-
declare const badRequestRoute: vitest.
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
declare const
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
declare const
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
639
|
+
declare const badRequestRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
640
|
+
(...args: any[]): any;
|
|
641
|
+
new (...args: any[]): any;
|
|
642
|
+
} & {};
|
|
643
|
+
declare const echoRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
644
|
+
(...args: any[]): any;
|
|
645
|
+
new (...args: any[]): any;
|
|
646
|
+
} & {};
|
|
647
|
+
declare const forbiddenRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
648
|
+
(...args: any[]): any;
|
|
649
|
+
new (...args: any[]): any;
|
|
650
|
+
} & {};
|
|
651
|
+
declare const goneRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
652
|
+
(...args: any[]): any;
|
|
653
|
+
new (...args: any[]): any;
|
|
654
|
+
} & {};
|
|
655
|
+
declare const methodNotAllowedRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
656
|
+
(...args: any[]): any;
|
|
657
|
+
new (...args: any[]): any;
|
|
658
|
+
} & {};
|
|
659
|
+
declare const noContentRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
660
|
+
(...args: any[]): any;
|
|
661
|
+
new (...args: any[]): any;
|
|
662
|
+
} & {};
|
|
663
|
+
declare const notFoundRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
664
|
+
(...args: any[]): any;
|
|
665
|
+
new (...args: any[]): any;
|
|
666
|
+
} & {};
|
|
667
|
+
declare const notImplementedRoute: vitest.MockInstance<(...args: any[]) => any> & {
|
|
668
|
+
(...args: any[]): any;
|
|
669
|
+
new (...args: any[]): any;
|
|
670
|
+
} & {};
|
|
671
|
+
declare const expressHttpCodeHandler: vitest.MockInstance<(...args: any[]) => any> & {
|
|
672
|
+
(...args: any[]): any;
|
|
673
|
+
new (...args: any[]): any;
|
|
674
|
+
} & {};
|
|
675
|
+
declare const cors: vitest.MockInstance<(...args: any[]) => any> & {
|
|
676
|
+
(...args: any[]): any;
|
|
677
|
+
new (...args: any[]): any;
|
|
678
|
+
} & {};
|
|
679
|
+
declare const fabricApiResponse: vitest.MockInstance<(...args: any[]) => any> & {
|
|
680
|
+
(...args: any[]): any;
|
|
681
|
+
new (...args: any[]): any;
|
|
682
|
+
} & {};
|
|
683
|
+
declare const getCurrentInvokeUuid: vitest.MockInstance<(...args: any[]) => any> & {
|
|
684
|
+
(...args: any[]): any;
|
|
685
|
+
new (...args: any[]): any;
|
|
686
|
+
} & {};
|
|
560
687
|
interface ExpressHandlerFunction {
|
|
561
688
|
(req: any, res: any, ...extra: any[]): Promise<any> | any;
|
|
562
689
|
}
|
|
@@ -585,9 +712,18 @@ declare const expressHandler: ((handlerOrProps: ExpressHandlerParameter, propsOr
|
|
|
585
712
|
mock: any;
|
|
586
713
|
};
|
|
587
714
|
|
|
588
|
-
declare const isLocalEnv: vitest.
|
|
589
|
-
|
|
590
|
-
|
|
715
|
+
declare const isLocalEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
716
|
+
(...args: any[]): any;
|
|
717
|
+
new (...args: any[]): any;
|
|
718
|
+
} & {};
|
|
719
|
+
declare const isNodeTestEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
720
|
+
(...args: any[]): any;
|
|
721
|
+
new (...args: any[]): any;
|
|
722
|
+
} & {};
|
|
723
|
+
declare const isProductionEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
724
|
+
(...args: any[]): any;
|
|
725
|
+
new (...args: any[]): any;
|
|
726
|
+
} & {};
|
|
591
727
|
|
|
592
728
|
type HandlerFunction = (...args: unknown[]) => unknown;
|
|
593
729
|
type LifecycleFunction = (...args: unknown[]) => unknown | Promise<unknown>;
|
|
@@ -640,9 +776,18 @@ declare const websocketHandler: ((handler: WebSocketHandlerFunction, props?: Lam
|
|
|
640
776
|
};
|
|
641
777
|
|
|
642
778
|
declare const LLM: typeof original$2.LLM;
|
|
643
|
-
declare const Llm: vitest.
|
|
644
|
-
|
|
645
|
-
|
|
779
|
+
declare const Llm: vitest.MockInstance<_vitest_spy.Procedure> & {
|
|
780
|
+
(...args: any[]): any;
|
|
781
|
+
new (...args: any[]): any;
|
|
782
|
+
} & {} & {
|
|
783
|
+
operate: vitest.MockInstance<(...args: any[]) => any> & {
|
|
784
|
+
(...args: any[]): any;
|
|
785
|
+
new (...args: any[]): any;
|
|
786
|
+
} & {};
|
|
787
|
+
send: vitest.MockInstance<(...args: any[]) => any> & {
|
|
788
|
+
(...args: any[]): any;
|
|
789
|
+
new (...args: any[]): any;
|
|
790
|
+
} & {};
|
|
646
791
|
};
|
|
647
792
|
declare const Toolkit: typeof original$2.Toolkit;
|
|
648
793
|
declare const JaypieToolkit: typeof original$2.JaypieToolkit;
|
|
@@ -650,6 +795,8 @@ declare const LlmMessageRole: typeof original$2.LlmMessageRole;
|
|
|
650
795
|
declare const LlmMessageType: typeof original$2.LlmMessageType;
|
|
651
796
|
declare const LlmStreamChunkType: typeof original$2.LlmStreamChunkType;
|
|
652
797
|
declare const BedrockProvider: typeof original$2.BedrockProvider;
|
|
798
|
+
declare const GoogleProvider: typeof original$2.GeminiProvider;
|
|
799
|
+
/** @deprecated Use GoogleProvider — "Google" is the provider; Gemini is the model family */
|
|
653
800
|
declare const GeminiProvider: typeof original$2.GeminiProvider;
|
|
654
801
|
declare const OpenRouterProvider: typeof original$2.OpenRouterProvider;
|
|
655
802
|
declare const XaiProvider: typeof original$2.XaiProvider;
|
|
@@ -727,14 +874,26 @@ declare module "vitest" {
|
|
|
727
874
|
}
|
|
728
875
|
}
|
|
729
876
|
|
|
730
|
-
declare const createLogger: vitest.
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
877
|
+
declare const createLogger: vitest.MockInstance<(...args: any[]) => any> & {
|
|
878
|
+
(...args: any[]): any;
|
|
879
|
+
new (...args: any[]): any;
|
|
880
|
+
} & {};
|
|
881
|
+
declare const _resetDatadogTransport: vitest.Mock<_vitest_spy.Procedure>;
|
|
882
|
+
declare const getDatadogTransport: vitest.Mock<_vitest_spy.Procedure>;
|
|
883
|
+
declare const isDatadogForwardingEnabled: vitest.Mock<_vitest_spy.Procedure>;
|
|
734
884
|
|
|
735
|
-
declare const connect: vitest.
|
|
736
|
-
|
|
737
|
-
|
|
885
|
+
declare const connect: vitest.MockInstance<(...args: any[]) => any> & {
|
|
886
|
+
(...args: any[]): any;
|
|
887
|
+
new (...args: any[]): any;
|
|
888
|
+
} & {};
|
|
889
|
+
declare const connectFromSecretEnv: vitest.MockInstance<(...args: any[]) => any> & {
|
|
890
|
+
(...args: any[]): any;
|
|
891
|
+
new (...args: any[]): any;
|
|
892
|
+
} & {};
|
|
893
|
+
declare const disconnect: vitest.MockInstance<(...args: any[]) => any> & {
|
|
894
|
+
(...args: any[]): any;
|
|
895
|
+
new (...args: any[]): any;
|
|
896
|
+
} & {};
|
|
738
897
|
|
|
739
898
|
/**
|
|
740
899
|
* Mock for MarkdownPage class from @jaypie/textract
|
|
@@ -743,12 +902,18 @@ declare const MarkdownPage: any;
|
|
|
743
902
|
/**
|
|
744
903
|
* Mock for textractJsonToMarkdown function from @jaypie/textract
|
|
745
904
|
*/
|
|
746
|
-
declare const textractJsonToMarkdown: vitest.
|
|
905
|
+
declare const textractJsonToMarkdown: vitest.MockInstance<(...args: any[]) => any> & {
|
|
906
|
+
(...args: any[]): any;
|
|
907
|
+
new (...args: any[]): any;
|
|
908
|
+
} & {};
|
|
747
909
|
|
|
748
910
|
declare const expandIncludes: ((...args: any[]) => any) & {
|
|
749
911
|
mock: any;
|
|
750
912
|
};
|
|
751
|
-
declare const isValidAlias: vitest.
|
|
913
|
+
declare const isValidAlias: vitest.MockInstance<(...args: any[]) => any> & {
|
|
914
|
+
(...args: any[]): any;
|
|
915
|
+
new (...args: any[]): any;
|
|
916
|
+
} & {};
|
|
752
917
|
declare const getAlternativeSpellings: ((...args: any[]) => any) & {
|
|
753
918
|
mock: any;
|
|
754
919
|
};
|
|
@@ -776,5 +941,5 @@ declare const createMemoryStore: ((...args: any[]) => any) & {
|
|
|
776
941
|
|
|
777
942
|
declare const mock: Record<string, any>;
|
|
778
943
|
|
|
779
|
-
export { APEX, ARCHIVED_SUFFIX, BadGatewayError, BadRequestError, BedrockProvider, ConfigurationError, ConflictError, CorsError, DATADOG, DELETED_SUFFIX, EXPRESS, ForbiddenError, GatewayTimeoutError, GeminiProvider, GoneError, 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 };
|
|
944
|
+
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 };
|
|
780
945
|
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 = {};
|
|
@@ -1135,15 +1146,21 @@ const mockOperate = createMockResolvedFunction({
|
|
|
1135
1146
|
],
|
|
1136
1147
|
});
|
|
1137
1148
|
const mockSend = createMockResolvedFunction("_MOCK_LLM_RESPONSE");
|
|
1138
|
-
const Llm = Object.assign(
|
|
1139
|
-
|
|
1140
|
-
|
|
1149
|
+
const Llm = Object.assign(
|
|
1150
|
+
// vitest 4 requires a constructable (non-arrow) implementation when the mock
|
|
1151
|
+
// is instantiated with `new`. A plain `function` returning an object replaces
|
|
1152
|
+
// the instance, preserving the previous mock shape.
|
|
1153
|
+
vi.fn().mockImplementation(function (providerName = "_MOCK_LLM_PROVIDER") {
|
|
1154
|
+
return {
|
|
1155
|
+
_provider: providerName,
|
|
1156
|
+
_llm: {
|
|
1157
|
+
operate: mockOperate,
|
|
1158
|
+
send: mockSend,
|
|
1159
|
+
},
|
|
1141
1160
|
operate: mockOperate,
|
|
1142
1161
|
send: mockSend,
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
send: mockSend,
|
|
1146
|
-
})), {
|
|
1162
|
+
};
|
|
1163
|
+
}), {
|
|
1147
1164
|
operate: mockOperate,
|
|
1148
1165
|
send: mockSend,
|
|
1149
1166
|
});
|
|
@@ -1174,9 +1191,11 @@ const LlmStreamChunkType = createMockWrappedObject(original$4.LlmStreamChunkType
|
|
|
1174
1191
|
const BedrockProvider = createMockWrappedObject(original$4.BedrockProvider, {
|
|
1175
1192
|
isClass: true,
|
|
1176
1193
|
});
|
|
1177
|
-
const
|
|
1194
|
+
const GoogleProvider = createMockWrappedObject(original$4.GoogleProvider, {
|
|
1178
1195
|
isClass: true,
|
|
1179
1196
|
});
|
|
1197
|
+
/** @deprecated Use GoogleProvider — "Google" is the provider; Gemini is the model family */
|
|
1198
|
+
const GeminiProvider = GoogleProvider;
|
|
1180
1199
|
const OpenRouterProvider = createMockWrappedObject(original$4.OpenRouterProvider, {
|
|
1181
1200
|
isClass: true,
|
|
1182
1201
|
});
|
|
@@ -1202,6 +1221,7 @@ var llm = /*#__PURE__*/Object.freeze({
|
|
|
1202
1221
|
__proto__: null,
|
|
1203
1222
|
BedrockProvider: BedrockProvider,
|
|
1204
1223
|
GeminiProvider: GeminiProvider,
|
|
1224
|
+
GoogleProvider: GoogleProvider,
|
|
1205
1225
|
JaypieToolkit: JaypieToolkit,
|
|
1206
1226
|
LLM: LLM,
|
|
1207
1227
|
Llm: Llm,
|
|
@@ -1387,5 +1407,5 @@ const mock = {
|
|
|
1387
1407
|
...tildeskill,
|
|
1388
1408
|
};
|
|
1389
1409
|
|
|
1390
|
-
export { APEX, ARCHIVED_SUFFIX, BadGatewayError, BadRequestError, BedrockProvider, ConfigurationError, ConflictError, CorsError, DATADOG, DELETED_SUFFIX, EXPRESS, ForbiddenError, GatewayTimeoutError, GeminiProvider, GoneError, 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 };
|
|
1410
|
+
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 };
|
|
1391
1411
|
//# sourceMappingURL=index.js.map
|