@jaypie/testkit 1.1.26 → 1.1.27

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.
Files changed (49) hide show
  1. package/dist/index.d.ts +241 -5
  2. package/dist/index.js +34 -13
  3. package/dist/index.js.map +1 -1
  4. package/dist/matchers/toBeMockFunction.matcher.d.ts +10 -0
  5. package/dist/matchers.module.d.ts +2 -0
  6. package/dist/mock/aws.d.ts +22 -0
  7. package/dist/mock/constants.d.ts +19 -0
  8. package/dist/mock/core.d.ts +306 -0
  9. package/dist/mock/datadog.d.ts +4 -0
  10. package/dist/mock/express.d.ts +32 -0
  11. package/dist/mock/index.d.ts +470 -0
  12. package/dist/mock/index.js +825 -0
  13. package/dist/mock/index.js.map +1 -0
  14. package/dist/mock/jsonApiSchema.module.d.ts +61 -0
  15. package/dist/mock/lambda.d.ts +15 -0
  16. package/dist/mock/llm.d.ts +66 -0
  17. package/dist/mock/matchers/toBeCalledAboveTrace.matcher.d.ts +3 -0
  18. package/dist/mock/matchers/toBeCalledWithInitialParams.matcher.d.ts +4 -0
  19. package/dist/mock/matchers/toBeClass.matcher.d.ts +3 -0
  20. package/dist/mock/matchers/toBeJaypieError.matcher.d.ts +3 -0
  21. package/dist/mock/matchers/toBeMockFunction.matcher.d.ts +10 -0
  22. package/dist/mock/matchers/toMatch.matcher.d.ts +12 -0
  23. package/dist/mock/matchers/toThrowError.matcher.d.ts +4 -0
  24. package/dist/mock/matchers/toThrowJaypieError.matcher.d.ts +16 -0
  25. package/dist/mock/matchers.module.d.ts +97 -0
  26. package/dist/mock/mock/aws.d.ts +22 -0
  27. package/dist/mock/mock/core.d.ts +306 -0
  28. package/dist/mock/mock/datadog.d.ts +4 -0
  29. package/dist/mock/mock/express.d.ts +32 -0
  30. package/dist/mock/mock/index.d.ts +10 -0
  31. package/dist/mock/mock/lambda.d.ts +15 -0
  32. package/dist/mock/mock/llm.d.ts +66 -0
  33. package/dist/mock/mock/mongoose.d.ts +4 -0
  34. package/dist/mock/mock/original.d.ts +19 -0
  35. package/dist/mock/mock/textract.d.ts +14 -0
  36. package/dist/mock/mock/utils.d.ts +42 -0
  37. package/dist/mock/mockLog.module.d.ts +5 -0
  38. package/dist/mock/mongoose.d.ts +4 -0
  39. package/dist/mock/original.d.ts +19 -0
  40. package/dist/mock/placeholders.d.ts +9 -0
  41. package/dist/mock/sqsTestRecords.function.d.ts +14 -0
  42. package/dist/mock/textract.d.ts +14 -0
  43. package/dist/mock/utils.d.ts +42 -0
  44. package/dist/mockLog.module.d.ts +3 -3
  45. package/dist/mockTextract.json +87 -752
  46. package/package.json +7 -4
  47. package/dist/jaypie.mock.d.ts +0 -70
  48. package/dist/jaypie.mock.js +0 -693
  49. package/dist/jaypie.mock.js.map +0 -1
@@ -0,0 +1,306 @@
1
+ import { log } from "@jaypie/core";
2
+ import * as original from "@jaypie/core";
3
+ export declare const BadGatewayError: typeof original.BadGatewayError;
4
+ export declare const BadRequestError: typeof original.BadRequestError;
5
+ export declare const ConfigurationError: typeof original.ConfigurationError;
6
+ export declare const ForbiddenError: typeof original.ForbiddenError;
7
+ export declare const GatewayTimeoutError: typeof original.GatewayTimeoutError;
8
+ export declare const GoneError: typeof original.GoneError;
9
+ export declare const IllogicalError: typeof original.IllogicalError;
10
+ export declare const InternalError: typeof original.InternalError;
11
+ export declare const MethodNotAllowedError: typeof original.MethodNotAllowedError;
12
+ export declare const MultiError: typeof original.ProjectMultiError;
13
+ export declare const NotFoundError: typeof original.NotFoundError;
14
+ export declare const NotImplementedError: typeof original.NotImplementedError;
15
+ export declare const ProjectError: typeof original.ProjectError;
16
+ export declare const ProjectMultiError: typeof original.ProjectMultiError;
17
+ export declare const RejectedError: typeof original.RejectedError;
18
+ export declare const TeapotError: typeof original.TeapotError;
19
+ export declare const UnauthorizedError: typeof original.UnauthorizedError;
20
+ export declare const UnavailableError: typeof original.UnavailableError;
21
+ export declare const UnhandledError: typeof original.UnhandledError;
22
+ export declare const UnreachableCodeError: typeof original.UnreachableCodeError;
23
+ export declare const validate: {
24
+ (argument: unknown, options?: original.ValidationOptions & {
25
+ type?: unknown;
26
+ }): boolean;
27
+ array<T = unknown>(argument: unknown, options?: original.ValidationOptions): argument is T[];
28
+ boolean(argument: unknown, options?: original.ValidationOptions): argument is boolean;
29
+ class(argument: unknown, options?: original.ValidationOptions): boolean;
30
+ function(argument: unknown, options?: original.ValidationOptions): argument is (...args: unknown[]) => unknown;
31
+ null(argument: unknown, options?: original.ValidationOptions): argument is null;
32
+ number(argument: unknown, options?: original.ValidationOptions): argument is number;
33
+ object<T extends Record<string, unknown> = Record<string, unknown>>(argument: unknown, options?: original.ValidationOptions): argument is T;
34
+ string(argument: unknown, options?: original.ValidationOptions): argument is string;
35
+ undefined(argument: unknown, options?: original.ValidationOptions): argument is undefined;
36
+ optional: {
37
+ array<T = unknown>(argument: unknown, options?: original.ValidationOptions): argument is T[] | undefined;
38
+ boolean(argument: unknown, options?: original.ValidationOptions): argument is boolean | undefined;
39
+ class(argument: unknown, options?: original.ValidationOptions): boolean;
40
+ function(argument: unknown, options?: original.ValidationOptions): argument is ((...args: unknown[]) => unknown) | undefined;
41
+ null(argument: unknown, options?: original.ValidationOptions): argument is null | undefined;
42
+ number(argument: unknown, options?: original.ValidationOptions): argument is number | undefined;
43
+ object<T extends Record<string, unknown> = Record<string, unknown>>(argument: unknown, options?: original.ValidationOptions): argument is T | undefined;
44
+ string(argument: unknown, options?: original.ValidationOptions): argument is string | undefined;
45
+ };
46
+ };
47
+ export { log };
48
+ export declare const cloneDeep: (...args: unknown[]) => unknown;
49
+ export declare const envBoolean: (...args: unknown[]) => boolean;
50
+ export declare const envsKey: (...args: unknown[]) => unknown;
51
+ export declare const errorFromStatusCode: ((statusCode: number, message?: string) => Error) & {
52
+ mock: any;
53
+ };
54
+ export declare const formatError: (...args: unknown[]) => unknown;
55
+ export declare const getHeaderFrom: (...args: unknown[]) => unknown;
56
+ export declare const getObjectKeyCaseInsensitive: (...args: unknown[]) => unknown;
57
+ export declare const isClass: (...args: unknown[]) => unknown;
58
+ export declare const isJaypieError: (...args: unknown[]) => unknown;
59
+ export declare const optional: {
60
+ (value: unknown, type: unknown, options?: Record<string, unknown>): boolean;
61
+ array<T = unknown>(value: unknown): value is T[] | undefined;
62
+ boolean(value: unknown): value is boolean | undefined;
63
+ number(value: unknown): value is number | undefined;
64
+ object<T extends Record<string, unknown> = Record<string, unknown>>(value: unknown): value is T | undefined;
65
+ positive(value: unknown): value is number | undefined;
66
+ string(value: unknown, defaultValue?: string): value is string | undefined;
67
+ };
68
+ export declare const required: {
69
+ (value: unknown, type: unknown, options?: Record<string, unknown>): boolean;
70
+ array<T = unknown>(value: unknown): value is T[];
71
+ boolean(value: unknown): value is boolean;
72
+ number(value: unknown): value is number;
73
+ object<T extends Record<string, unknown> = Record<string, unknown>>(value: unknown): value is T;
74
+ positive(value: unknown): value is number;
75
+ string(value: unknown, defaultValue?: string): value is string;
76
+ };
77
+ export declare const safeParseFloat: (...args: unknown[]) => unknown;
78
+ export declare const placeholders: (...args: unknown[]) => unknown;
79
+ export declare const force: {
80
+ (value: unknown, type: unknown, options?: string | {
81
+ key?: string;
82
+ maximum?: number;
83
+ minimum?: number;
84
+ nan?: boolean;
85
+ }): unknown;
86
+ array<T = unknown>(value: unknown): T[];
87
+ boolean(value: unknown): boolean;
88
+ number(value: unknown): number;
89
+ object<T extends Record<string, unknown> = Record<string, unknown>>(value: unknown, key?: string): T;
90
+ positive(value: unknown): number;
91
+ string(value: unknown, defaultValue?: string): string;
92
+ };
93
+ export declare const jaypieHandler: ((handler: Function, options?: {
94
+ setup?: Function | Function[];
95
+ teardown?: Function | Function[];
96
+ unavailable?: boolean;
97
+ validate?: Function | Function[];
98
+ }) => Function) & {
99
+ mock: any;
100
+ };
101
+ export declare const sleep: (...args: unknown[]) => Promise<boolean>;
102
+ export declare const uuid: (...args: unknown[]) => unknown;
103
+ export declare const ERROR: {
104
+ MESSAGE: {
105
+ BAD_GATEWAY: "An unexpected error occurred on an upstream resource";
106
+ BAD_REQUEST: "The request was not properly formatted";
107
+ CONFIGURATION_ERROR: "The application responding to the request encountered a configuration error";
108
+ FORBIDDEN: "Access to this resource is not authorized";
109
+ GATEWAY_TIMEOUT: "The connection timed out waiting for an upstream resource";
110
+ GONE: "The requested resource is no longer available";
111
+ ILLOGICAL: "The application encountered an illogical condition while processing the request";
112
+ INTERNAL_ERROR: "An unexpected error occurred and the request was unable to complete";
113
+ METHOD_NOT_ALLOWED: "The requested method is not allowed";
114
+ NOT_FOUND: "The requested resource was not found";
115
+ NOT_IMPLEMENTED: "The request was understood but the resource is not implemented";
116
+ REJECTED: "The request was rejected prior to processing";
117
+ TEAPOT: "This resource is a teapot incapable of processing the request";
118
+ UNAUTHORIZED: "The request did not include valid authentication credentials";
119
+ UNAVAILABLE: "The requested resource is temporarily unavailable";
120
+ UNHANDLED: "An unhandled error occurred and the request was unable to complete";
121
+ UNREACHABLE_CODE: "The application encountered an unreachable condition while processing the request";
122
+ };
123
+ TITLE: {
124
+ BAD_GATEWAY: "Bad Gateway";
125
+ BAD_REQUEST: "Bad Request";
126
+ CONFIGURATION_ERROR: "Internal Configuration Error";
127
+ FORBIDDEN: "Forbidden";
128
+ GATEWAY_TIMEOUT: "Gateway Timeout";
129
+ GONE: "Gone";
130
+ INTERNAL_ERROR: "Internal Application Error";
131
+ METHOD_NOT_ALLOWED: "Method Not Allowed";
132
+ NOT_FOUND: "Not Found";
133
+ NOT_IMPLEMENTED: "Not Implemented";
134
+ REJECTED: "Request Rejected";
135
+ TEAPOT: "Teapot";
136
+ UNAUTHORIZED: "Service Unauthorized";
137
+ UNAVAILABLE: "Service Unavailable";
138
+ };
139
+ TYPE: {
140
+ BAD_GATEWAY: "BAD_GATEWAY";
141
+ BAD_REQUEST: "BAD_REQUEST";
142
+ CONFIGURATION_ERROR: "CONFIGURATION_ERROR";
143
+ FORBIDDEN: "FORBIDDEN";
144
+ GATEWAY_TIMEOUT: "GATEWAY_TIMEOUT";
145
+ GONE: "GONE";
146
+ ILLOGICAL: "ILLOGICAL";
147
+ INTERNAL_ERROR: "INTERNAL_ERROR";
148
+ METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
149
+ MULTI_ERROR: "MULTI_ERROR";
150
+ NOT_FOUND: "NOT_FOUND";
151
+ NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
152
+ REJECTED: "REJECTED";
153
+ TEAPOT: "TEAPOT";
154
+ UNAUTHORIZED: "UNAUTHORIZED";
155
+ UNAVAILABLE: "UNAVAILABLE";
156
+ UNHANDLED: "UNHANDLED";
157
+ UNKNOWN_TYPE: "UNKNOWN_TYPE";
158
+ UNREACHABLE_CODE: "UNREACHABLE_CODE";
159
+ };
160
+ };
161
+ export declare const HTTP: {
162
+ ALLOW: {
163
+ ANY: "*";
164
+ };
165
+ CODE: {
166
+ OK: 200;
167
+ CREATED: 201;
168
+ ACCEPTED: 202;
169
+ NO_CONTENT: 204;
170
+ FOUND: 302;
171
+ BAD_REQUEST: 400;
172
+ UNAUTHORIZED: 401;
173
+ FORBIDDEN: 403;
174
+ NOT_FOUND: 404;
175
+ METHOD_NOT_ALLOWED: 405;
176
+ CONFLICT: 409;
177
+ GONE: 410;
178
+ TEAPOT: 418;
179
+ INTERNAL_ERROR: 500;
180
+ BAD_GATEWAY: 502;
181
+ UNAVAILABLE: 503;
182
+ GATEWAY_TIMEOUT: 504;
183
+ };
184
+ CONTENT: {
185
+ ANY: "*/*";
186
+ HTML: "text/html";
187
+ JSON: "application/json";
188
+ TEXT: "text/plain";
189
+ };
190
+ HEADER: {
191
+ ACCEPT: "Accept";
192
+ ACCEPT_ENCODING: "Accept-Encoding";
193
+ ALLOW: {
194
+ HEADERS: "Access-Control-Allow-Headers";
195
+ METHODS: "Access-Control-Allow-Methods";
196
+ ORIGIN: "Access-Control-Allow-Origin";
197
+ };
198
+ AMAZON: {
199
+ CF_ID: "X-Amz-Cf-Id";
200
+ CLOUDFRONT_COUNTRY: "CloudFront-Viewer-Country";
201
+ CLOUDFRONT_DESKTOP: "CloudFront-Is-Desktop-Viewer";
202
+ CLOUDFRONT_MOBILE: "CloudFront-Is-Mobile-Viewer";
203
+ CLOUDFRONT_PROTOCOL: "CloudFront-Forwarded-Proto";
204
+ CLOUDFRONT_SMARTTV: "CloudFront-Is-SmartTV-Viewer";
205
+ CLOUDFRONT_TABLET: "CloudFront-Is-Tablet-Viewer";
206
+ TRACE_ID: "X-Amzn-Trace-Id";
207
+ };
208
+ AUTHORIZATION: "Authorization";
209
+ CACHE_CONTROL: "Cache-Control";
210
+ CONTENT_TYPE: "Content-Type";
211
+ COOKIE: {
212
+ REQUEST: "Cookie";
213
+ RESPONSE: "Set-Cookie";
214
+ };
215
+ DATADOG: {
216
+ SESSION_ID: "X-Session-Id";
217
+ };
218
+ FORWARDED: {
219
+ FOR: "X-Forwarded-For";
220
+ PORT: "X-Forwarded-Port";
221
+ PROTOCOL: "X-Forwarded-Proto";
222
+ };
223
+ HOST: "Host";
224
+ ORIGIN: "Origin";
225
+ POSTMAN: {
226
+ TOKEN: "Postman-Token";
227
+ };
228
+ POWERED_BY: "X-Powered-By";
229
+ PROJECT: {
230
+ ACCOUNT: "X-Project-Account";
231
+ CALLER: "X-Project-Caller";
232
+ ENVIRONMENT: "X-Project-Environment";
233
+ KEY: "X-Project-Key";
234
+ HANDLER: "X-Project-Handler";
235
+ INVOCATION: "X-Project-Invocation";
236
+ ROOT_INVOCATION: "X-Project-Root-Invocation";
237
+ SECRET: "X-Project-Secret";
238
+ SEED: "X-Project-Seed";
239
+ SESSION: "X-Project-Session";
240
+ VERSION: "X-Project-Version";
241
+ };
242
+ SIGNATURE: {
243
+ ED25519: "X-Signature-Ed25519";
244
+ TIMESTAMP: "X-Signature-Timestamp";
245
+ };
246
+ USER_AGENT: "User-Agent";
247
+ VIA: "Via";
248
+ };
249
+ METHOD: {
250
+ DELETE: "DELETE";
251
+ HEAD: "HEAD";
252
+ GET: "GET";
253
+ OPTIONS: "OPTIONS";
254
+ POST: "POST";
255
+ PUT: "PUT";
256
+ };
257
+ RESPONSE: Record<string, unknown>;
258
+ };
259
+ export declare const JAYPIE: {
260
+ LIB: {
261
+ AWS: "@jaypie/aws";
262
+ CDK: "@jaypie/cdk";
263
+ CONSTRUCTS: "@jaypie/constructs";
264
+ CORE: "@jaypie/core";
265
+ ESLINT: "@jaypie/eslint";
266
+ EXPRESS: "@jaypie/express";
267
+ ERRORS: "@jaypie/errors";
268
+ JAYPIE: "jaypie";
269
+ LAMBDA: "@jaypie/lambda";
270
+ LLM: "@jaypie/llm";
271
+ MONGOOSE: "@jaypie/mongoose";
272
+ TESTKIT: "@jaypie/testkit";
273
+ WEBKIT: "@jaypie/webkit";
274
+ };
275
+ LAYER: {
276
+ EXPRESS: "express";
277
+ HANDLER: "handler";
278
+ JAYPIE: "jaypie";
279
+ LAMBDA: "lambda";
280
+ MODULE: "module";
281
+ };
282
+ LOGGER: {
283
+ DEFAULT: "default";
284
+ MODULE: "module";
285
+ };
286
+ UNKNOWN: "unknown";
287
+ };
288
+ export declare const PROJECT: {
289
+ SPONSOR: {
290
+ FINLAYSON: "finlaysonstudio";
291
+ JAYPIE: "jaypie";
292
+ KNOWDEV: "knowdev.studio";
293
+ };
294
+ };
295
+ export declare const VALIDATE: {
296
+ ANY: "*";
297
+ ARRAY: ArrayConstructor;
298
+ BOOLEAN: BooleanConstructor;
299
+ CLASS: "_CLASS";
300
+ FUNCTION: FunctionConstructor;
301
+ NUMBER: NumberConstructor;
302
+ NULL: null;
303
+ OBJECT: ObjectConstructor;
304
+ STRING: StringConstructor;
305
+ UNDEFINED: "_UNDEFINED";
306
+ };
@@ -0,0 +1,4 @@
1
+ import * as original from "@jaypie/datadog";
2
+ export declare const DATADOG: original.DatadogConstants;
3
+ export declare const submitMetric: (...args: unknown[]) => Promise<boolean>;
4
+ export declare const submitMetricSet: (...args: unknown[]) => Promise<boolean>;
@@ -0,0 +1,32 @@
1
+ export declare const EXPRESS: {
2
+ PATH: {
3
+ ANY: "*";
4
+ ID: "/:id";
5
+ ROOT: RegExp;
6
+ };
7
+ };
8
+ export declare const badRequestRoute: (...args: unknown[]) => unknown;
9
+ export declare const echoRoute: (...args: unknown[]) => unknown;
10
+ export declare const forbiddenRoute: (...args: unknown[]) => unknown;
11
+ export declare const goneRoute: (...args: unknown[]) => unknown;
12
+ export declare const methodNotAllowedRoute: (...args: unknown[]) => unknown;
13
+ export declare const noContentRoute: (...args: unknown[]) => unknown;
14
+ export declare const notFoundRoute: (...args: unknown[]) => unknown;
15
+ export declare const notImplementedRoute: (...args: unknown[]) => unknown;
16
+ export declare const expressHttpCodeHandler: (...args: unknown[]) => unknown;
17
+ export declare const cors: (...args: unknown[]) => unknown;
18
+ export interface ExpressHandlerFunction {
19
+ (req: any, res: any, ...extra: any[]): Promise<any> | any;
20
+ }
21
+ export interface ExpressHandlerOptions {
22
+ locals?: Record<string, any>;
23
+ setup?: any[] | Function;
24
+ teardown?: any[] | Function;
25
+ unavailable?: boolean;
26
+ validate?: any[] | Function;
27
+ }
28
+ type ExpressHandlerParameter = ExpressHandlerFunction | ExpressHandlerOptions;
29
+ export declare const expressHandler: ((handlerOrProps: ExpressHandlerParameter, propsOrHandler?: ExpressHandlerParameter) => (req: any, res: any, ...extra: any[]) => Promise<any>) & {
30
+ mock: any;
31
+ };
32
+ export {};
@@ -0,0 +1,10 @@
1
+ export * from "./aws";
2
+ export * from "./core";
3
+ export * from "./datadog";
4
+ export * from "./express";
5
+ export * from "./lambda";
6
+ export * from "./llm";
7
+ export * from "./mongoose";
8
+ export * from "./textract";
9
+ declare const _default: Record<string, unknown>;
10
+ export default _default;
@@ -0,0 +1,15 @@
1
+ type HandlerFunction = (...args: unknown[]) => unknown;
2
+ type LifecycleFunction = (...args: unknown[]) => unknown | Promise<unknown>;
3
+ export interface LambdaOptions {
4
+ name?: string;
5
+ setup?: LifecycleFunction | LifecycleFunction[];
6
+ teardown?: LifecycleFunction | LifecycleFunction[];
7
+ throw?: boolean;
8
+ unavailable?: boolean;
9
+ validate?: LifecycleFunction | LifecycleFunction[];
10
+ [key: string]: unknown;
11
+ }
12
+ export declare const lambdaHandler: ((handler: HandlerFunction, props?: LambdaOptions) => HandlerFunction) & {
13
+ mock: any;
14
+ };
15
+ export {};
@@ -0,0 +1,66 @@
1
+ import * as original from "@jaypie/llm";
2
+ export declare const LLM: typeof original.LLM;
3
+ export declare const Llm: import("vitest").Mock<(...args: any[]) => any> & {
4
+ operate: (...args: unknown[]) => Promise<{
5
+ history: ({
6
+ content: string;
7
+ role: string;
8
+ type: string;
9
+ id?: undefined;
10
+ status?: undefined;
11
+ } | {
12
+ id: string;
13
+ type: string;
14
+ status: string;
15
+ content: string;
16
+ role: string;
17
+ })[];
18
+ output: {
19
+ id: string;
20
+ type: string;
21
+ status: string;
22
+ content: string;
23
+ role: string;
24
+ }[];
25
+ responses: {
26
+ id: string;
27
+ object: string;
28
+ created_at: number;
29
+ status: string;
30
+ error: null;
31
+ output_text: string;
32
+ }[];
33
+ status: string;
34
+ usage: {
35
+ input: number;
36
+ output: number;
37
+ reasoning: number;
38
+ total: number;
39
+ };
40
+ content: string;
41
+ }>;
42
+ send: (...args: unknown[]) => Promise<string>;
43
+ };
44
+ export declare const toolkit: {
45
+ random: (...args: unknown[]) => number;
46
+ roll: (...args: unknown[]) => number;
47
+ time: (...args: unknown[]) => string;
48
+ weather: (...args: unknown[]) => Promise<{
49
+ location: string;
50
+ forecast: {
51
+ date: string;
52
+ temperature: number;
53
+ condition: string;
54
+ precipitation: number;
55
+ }[];
56
+ }>;
57
+ };
58
+ export declare const tools: (((...args: unknown[]) => number) | ((...args: unknown[]) => string) | ((...args: unknown[]) => Promise<{
59
+ location: string;
60
+ forecast: {
61
+ date: string;
62
+ temperature: number;
63
+ condition: string;
64
+ precipitation: number;
65
+ }[];
66
+ }>))[];
@@ -0,0 +1,4 @@
1
+ export declare const connect: (...args: unknown[]) => boolean;
2
+ export declare const connectFromSecretEnv: (...args: unknown[]) => boolean;
3
+ export declare const disconnect: (...args: unknown[]) => boolean;
4
+ export { mongoose } from "@jaypie/mongoose";
@@ -0,0 +1,19 @@
1
+ import * as aws from "@jaypie/aws";
2
+ import * as core from "@jaypie/core";
3
+ import * as datadog from "@jaypie/datadog";
4
+ import * as express from "@jaypie/express";
5
+ import * as lambda from "@jaypie/lambda";
6
+ import * as llm from "@jaypie/llm";
7
+ import * as mongoose from "@jaypie/mongoose";
8
+ import * as textract from "@jaypie/textract";
9
+ export declare const original: {
10
+ aws: typeof aws;
11
+ core: typeof core;
12
+ datadog: typeof datadog;
13
+ express: typeof express;
14
+ lambda: typeof lambda;
15
+ llm: typeof llm;
16
+ mongoose: typeof mongoose;
17
+ textract: typeof textract;
18
+ };
19
+ export default original;
@@ -0,0 +1,14 @@
1
+ import * as original from "@jaypie/textract";
2
+ /**
3
+ * Mock for MarkdownPage class from @jaypie/textract
4
+ */
5
+ export declare const MarkdownPage: typeof original.MarkdownPage;
6
+ /**
7
+ * Mock for textractJsonToMarkdown function from @jaypie/textract
8
+ */
9
+ export declare const textractJsonToMarkdown: (...args: unknown[]) => string;
10
+ declare const _default: {
11
+ MarkdownPage: typeof original.MarkdownPage;
12
+ textractJsonToMarkdown: (...args: unknown[]) => string;
13
+ };
14
+ export default _default;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Creates function mocks with proper typing
3
+ * Internal utility to create properly typed mocks
4
+ */
5
+ declare function createMockFunction<T extends (...args: any[]) => any>(implementation?: (...args: Parameters<T>) => ReturnType<T>): T & {
6
+ mock: any;
7
+ };
8
+ /**
9
+ * Creates a mock function that resolves to a value when awaited
10
+ * Internal utility to create async mock functions
11
+ */
12
+ declare function createMockResolvedFunction<T>(value: T): (...args: unknown[]) => Promise<T>;
13
+ /**
14
+ * Creates a mock function that returns a value
15
+ * Internal utility to create mock functions that return a value
16
+ */
17
+ declare function createMockReturnedFunction<T>(value: T): (...args: unknown[]) => T;
18
+ /**
19
+ * Creates a mock function that wraps another function
20
+ * Internal utility to create mock functions that wrap another function
21
+ */
22
+ declare function createMockWrappedFunction<T>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
23
+ fallback?: any;
24
+ throws?: boolean;
25
+ class?: boolean;
26
+ }): (...args: unknown[]) => T;
27
+ declare function createMockWrappedObject<T extends Record<string, any>>(object: T, fallbackOrOptions?: any | {
28
+ fallback?: any;
29
+ throws?: boolean;
30
+ class?: boolean;
31
+ }): T;
32
+ /**
33
+ * Utility to create a mock error constructor from an error class
34
+ */
35
+ declare function createMockError<T extends new (...args: any[]) => Error>(ErrorClass: T): T;
36
+ declare class MockValidationError extends Error {
37
+ constructor(message: string);
38
+ }
39
+ declare class MockNotFoundError extends Error {
40
+ constructor(message: string);
41
+ }
42
+ export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, };
@@ -0,0 +1,5 @@
1
+ import { log } from "@jaypie/core";
2
+ import { LogMock } from "./types/jaypie-testkit";
3
+ export declare function mockLogFactory(): LogMock;
4
+ export declare function spyLog(logInstance: typeof log): void;
5
+ export declare function restoreLog(logInstance: typeof log): void;
@@ -0,0 +1,4 @@
1
+ export declare const connect: (...args: unknown[]) => boolean;
2
+ export declare const connectFromSecretEnv: (...args: unknown[]) => boolean;
3
+ export declare const disconnect: (...args: unknown[]) => boolean;
4
+ export { mongoose } from "@jaypie/mongoose";
@@ -0,0 +1,19 @@
1
+ import * as aws from "@jaypie/aws";
2
+ import * as core from "@jaypie/core";
3
+ import * as datadog from "@jaypie/datadog";
4
+ import * as express from "@jaypie/express";
5
+ import * as lambda from "@jaypie/lambda";
6
+ import * as llm from "@jaypie/llm";
7
+ import * as mongoose from "@jaypie/mongoose";
8
+ import * as textract from "@jaypie/textract";
9
+ export declare const original: {
10
+ aws: typeof aws;
11
+ core: typeof core;
12
+ datadog: typeof datadog;
13
+ express: typeof express;
14
+ lambda: typeof lambda;
15
+ llm: typeof llm;
16
+ mongoose: typeof mongoose;
17
+ textract: typeof textract;
18
+ };
19
+ export default original;
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Replaces placeholders with real content
3
+ * Requires get() - https://vanillajstoolkit.com/helpers/get/
4
+ * (c) 2019 Chris Ferdinandi, MIT License, https://gomakethings.com
5
+ * @param {String} template The template string
6
+ * @param {String} local A local placeholder to use, if any
7
+ */
8
+ declare function placeholders(template: string | (() => string), data?: Record<string, unknown>): string;
9
+ export default placeholders;
@@ -0,0 +1,14 @@
1
+ interface SQSEvent {
2
+ Records: Array<{
3
+ body: string;
4
+ messageId?: string | number;
5
+ [key: string]: unknown;
6
+ }>;
7
+ }
8
+ /**
9
+ * Creates a mock SQS event with the given records
10
+ * @param records - Array of records or individual records to include in the event
11
+ * @returns SQS event object with Records array
12
+ */
13
+ declare const sqsTestRecords: (...records: Array<unknown>) => SQSEvent;
14
+ export default sqsTestRecords;
@@ -0,0 +1,14 @@
1
+ import * as original from "@jaypie/textract";
2
+ /**
3
+ * Mock for MarkdownPage class from @jaypie/textract
4
+ */
5
+ export declare const MarkdownPage: typeof original.MarkdownPage;
6
+ /**
7
+ * Mock for textractJsonToMarkdown function from @jaypie/textract
8
+ */
9
+ export declare const textractJsonToMarkdown: (...args: unknown[]) => string;
10
+ declare const _default: {
11
+ MarkdownPage: typeof original.MarkdownPage;
12
+ textractJsonToMarkdown: (...args: unknown[]) => string;
13
+ };
14
+ export default _default;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Creates function mocks with proper typing
3
+ * Internal utility to create properly typed mocks
4
+ */
5
+ declare function createMockFunction<T extends (...args: any[]) => any>(implementation?: (...args: Parameters<T>) => ReturnType<T>): T & {
6
+ mock: any;
7
+ };
8
+ /**
9
+ * Creates a mock function that resolves to a value when awaited
10
+ * Internal utility to create async mock functions
11
+ */
12
+ declare function createMockResolvedFunction<T>(value: T): (...args: unknown[]) => Promise<T>;
13
+ /**
14
+ * Creates a mock function that returns a value
15
+ * Internal utility to create mock functions that return a value
16
+ */
17
+ declare function createMockReturnedFunction<T>(value: T): (...args: unknown[]) => T;
18
+ /**
19
+ * Creates a mock function that wraps another function
20
+ * Internal utility to create mock functions that wrap another function
21
+ */
22
+ declare function createMockWrappedFunction<T>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
23
+ fallback?: any;
24
+ throws?: boolean;
25
+ class?: boolean;
26
+ }): (...args: unknown[]) => T;
27
+ declare function createMockWrappedObject<T extends Record<string, any>>(object: T, fallbackOrOptions?: any | {
28
+ fallback?: any;
29
+ throws?: boolean;
30
+ class?: boolean;
31
+ }): T;
32
+ /**
33
+ * Utility to create a mock error constructor from an error class
34
+ */
35
+ declare function createMockError<T extends new (...args: any[]) => Error>(ErrorClass: T): T;
36
+ declare class MockValidationError extends Error {
37
+ constructor(message: string);
38
+ }
39
+ declare class MockNotFoundError extends Error {
40
+ constructor(message: string);
41
+ }
42
+ export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, };
@@ -1,5 +1,5 @@
1
- import { Log } from "@jaypie/core";
1
+ import { log } from "@jaypie/core";
2
2
  import { LogMock } from "./types/jaypie-testkit";
3
3
  export declare function mockLogFactory(): LogMock;
4
- export declare function spyLog(log: Log): void;
5
- export declare function restoreLog(log: Log): void;
4
+ export declare function spyLog(logInstance: typeof log): void;
5
+ export declare function restoreLog(logInstance: typeof log): void;