@jaypie/testkit 1.1.25 → 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.
- package/dist/index.d.ts +241 -5
- package/dist/index.js +36 -15
- package/dist/index.js.map +1 -1
- package/dist/matchers/toBeMockFunction.matcher.d.ts +10 -0
- package/dist/matchers.module.d.ts +2 -0
- package/dist/mock/aws.d.ts +22 -0
- package/dist/mock/constants.d.ts +19 -0
- package/dist/mock/core.d.ts +306 -0
- package/dist/mock/datadog.d.ts +4 -0
- package/dist/mock/express.d.ts +32 -0
- package/dist/mock/index.d.ts +470 -0
- package/dist/mock/index.js +825 -0
- package/dist/mock/index.js.map +1 -0
- package/dist/mock/jsonApiSchema.module.d.ts +61 -0
- package/dist/mock/lambda.d.ts +15 -0
- package/dist/mock/llm.d.ts +66 -0
- package/dist/mock/matchers/toBeCalledAboveTrace.matcher.d.ts +3 -0
- package/dist/mock/matchers/toBeCalledWithInitialParams.matcher.d.ts +4 -0
- package/dist/mock/matchers/toBeClass.matcher.d.ts +3 -0
- package/dist/mock/matchers/toBeJaypieError.matcher.d.ts +3 -0
- package/dist/mock/matchers/toBeMockFunction.matcher.d.ts +10 -0
- package/dist/mock/matchers/toMatch.matcher.d.ts +12 -0
- package/dist/mock/matchers/toThrowError.matcher.d.ts +4 -0
- package/dist/mock/matchers/toThrowJaypieError.matcher.d.ts +16 -0
- package/dist/mock/matchers.module.d.ts +97 -0
- package/dist/mock/mock/aws.d.ts +22 -0
- package/dist/mock/mock/core.d.ts +306 -0
- package/dist/mock/mock/datadog.d.ts +4 -0
- package/dist/mock/mock/express.d.ts +32 -0
- package/dist/mock/mock/index.d.ts +10 -0
- package/dist/mock/mock/lambda.d.ts +15 -0
- package/dist/mock/mock/llm.d.ts +66 -0
- package/dist/mock/mock/mongoose.d.ts +4 -0
- package/dist/mock/mock/original.d.ts +19 -0
- package/dist/mock/mock/textract.d.ts +14 -0
- package/dist/mock/mock/utils.d.ts +42 -0
- package/dist/mock/mockLog.module.d.ts +5 -0
- package/dist/mock/mongoose.d.ts +4 -0
- package/dist/mock/original.d.ts +19 -0
- package/dist/mock/placeholders.d.ts +9 -0
- package/dist/mock/sqsTestRecords.function.d.ts +14 -0
- package/dist/mock/textract.d.ts +14 -0
- package/dist/mock/utils.d.ts +42 -0
- package/dist/mockLog.module.d.ts +3 -3
- package/dist/mockTextract.json +87 -752
- package/package.json +8 -7
- package/dist/jaypie.mock.d.ts +0 -69
- package/dist/jaypie.mock.js +0 -633
- package/dist/jaypie.mock.js.map +0 -1
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
import * as original from '@jaypie/aws';
|
|
2
|
+
import { vi, beforeAll } from 'vitest';
|
|
3
|
+
import * as original$1 from '@jaypie/core';
|
|
4
|
+
import { log, BadRequestError as BadRequestError$1, UnhandledError as UnhandledError$1 } from '@jaypie/core';
|
|
5
|
+
export { log } from '@jaypie/core';
|
|
6
|
+
import * as original$2 from '@jaypie/datadog';
|
|
7
|
+
import * as original$3 from '@jaypie/express';
|
|
8
|
+
import * as original$4 from '@jaypie/llm';
|
|
9
|
+
import { mongoose as mongoose$1 } from '@jaypie/mongoose';
|
|
10
|
+
export { mongoose } from '@jaypie/mongoose';
|
|
11
|
+
import { readFile } from 'fs/promises';
|
|
12
|
+
import { dirname, join } from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
import { TextractDocument } from 'amazon-textract-response-parser';
|
|
15
|
+
import * as original$5 from '@jaypie/textract';
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
|
+
/**
|
|
19
|
+
* Internal wrapper for vi.fn() that adds _jaypie: true to all mocks
|
|
20
|
+
*/
|
|
21
|
+
function _createJaypieMock(implementation) {
|
|
22
|
+
const mock = vi.fn(implementation);
|
|
23
|
+
Object.defineProperty(mock, "_jaypie", { value: true });
|
|
24
|
+
return mock;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates function mocks with proper typing
|
|
28
|
+
* Internal utility to create properly typed mocks
|
|
29
|
+
*/
|
|
30
|
+
function createMockFunction(implementation) {
|
|
31
|
+
// Use a more specific type conversion to avoid TypeScript error
|
|
32
|
+
return _createJaypieMock(implementation);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a mock function that resolves to a value when awaited
|
|
36
|
+
* Internal utility to create async mock functions
|
|
37
|
+
*/
|
|
38
|
+
function createMockResolvedFunction(value) {
|
|
39
|
+
return _createJaypieMock().mockResolvedValue(value);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a mock function that returns a value
|
|
43
|
+
* Internal utility to create mock functions that return a value
|
|
44
|
+
*/
|
|
45
|
+
function createMockReturnedFunction(value) {
|
|
46
|
+
return _createJaypieMock().mockReturnValue(value);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Creates a mock function that wraps another function
|
|
50
|
+
* Internal utility to create mock functions that wrap another function
|
|
51
|
+
*/
|
|
52
|
+
function createMockWrappedFunction(fn, fallbackOrOptions = "_MOCK_WRAPPED_RESULT") {
|
|
53
|
+
// Determine if we have a direct fallback or options object
|
|
54
|
+
const options = typeof fallbackOrOptions === "object" &&
|
|
55
|
+
fallbackOrOptions !== null &&
|
|
56
|
+
("fallback" in fallbackOrOptions ||
|
|
57
|
+
"throws" in fallbackOrOptions ||
|
|
58
|
+
"class" in fallbackOrOptions)
|
|
59
|
+
? fallbackOrOptions
|
|
60
|
+
: { fallback: fallbackOrOptions };
|
|
61
|
+
// Extract values with defaults
|
|
62
|
+
const fallback = options.fallback ?? "_MOCK_WRAPPED_RESULT";
|
|
63
|
+
const throws = options.throws ?? false;
|
|
64
|
+
const isClass = options.class ?? false;
|
|
65
|
+
return _createJaypieMock().mockImplementation((...args) => {
|
|
66
|
+
try {
|
|
67
|
+
return isClass ? new fn(...args) : fn(...args);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (throws) {
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
/* eslint-disable no-console */
|
|
74
|
+
console.warn(`[@jaypie/testkit] Actual implementation failed. To suppress this warning, manually mock the response with mockReturnValue`);
|
|
75
|
+
if (error instanceof Error) {
|
|
76
|
+
console.warn(`[@jaypie/testkit] ${error.message}`);
|
|
77
|
+
}
|
|
78
|
+
/* eslint-enable no-console */
|
|
79
|
+
// If fallback is a function, call it
|
|
80
|
+
if (typeof fallback === "function") {
|
|
81
|
+
try {
|
|
82
|
+
return fallback(...args);
|
|
83
|
+
}
|
|
84
|
+
catch (fallbackError) {
|
|
85
|
+
console.warn(`[@jaypie/testkit] Fallback function failed: ${fallbackError instanceof Error ? fallbackError.message : fallbackError}`);
|
|
86
|
+
return "_MOCK_WRAPPED_RESULT";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return fallback;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function createMockWrappedObject(object, fallbackOrOptions = "_MOCK_WRAPPED_RESULT") {
|
|
94
|
+
let returnMock = {};
|
|
95
|
+
// Extract values with defaults for the top-level call
|
|
96
|
+
const options = typeof fallbackOrOptions === "object" &&
|
|
97
|
+
fallbackOrOptions !== null &&
|
|
98
|
+
("fallback" in fallbackOrOptions ||
|
|
99
|
+
"throws" in fallbackOrOptions ||
|
|
100
|
+
"class" in fallbackOrOptions)
|
|
101
|
+
? fallbackOrOptions
|
|
102
|
+
: { fallback: fallbackOrOptions };
|
|
103
|
+
const fallback = options.fallback ?? "_MOCK_WRAPPED_RESULT";
|
|
104
|
+
const throws = options.throws ?? false;
|
|
105
|
+
const isClass = options.class ?? false;
|
|
106
|
+
// Create options for recursive calls
|
|
107
|
+
// Do not pass down class=true to nested objects
|
|
108
|
+
const recursiveOptions = {
|
|
109
|
+
fallback,
|
|
110
|
+
throws,
|
|
111
|
+
class: false, // Always pass class=false to nested objects
|
|
112
|
+
};
|
|
113
|
+
if (typeof object === "function") {
|
|
114
|
+
returnMock = createMockWrappedFunction(object, {
|
|
115
|
+
fallback,
|
|
116
|
+
throws,
|
|
117
|
+
class: isClass,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
for (const key of Object.keys(object)) {
|
|
121
|
+
const value = object[key];
|
|
122
|
+
if (typeof value === "function") {
|
|
123
|
+
returnMock[key] = createMockWrappedFunction(value, {
|
|
124
|
+
fallback,
|
|
125
|
+
throws,
|
|
126
|
+
class: isClass,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else if (typeof value === "object" && value !== null) {
|
|
130
|
+
returnMock[key] = createMockWrappedObject(value, recursiveOptions);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
returnMock[key] = value;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return returnMock;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Utility to create a mock error constructor from an error class
|
|
140
|
+
*/
|
|
141
|
+
function createMockError(ErrorClass) {
|
|
142
|
+
// Create a mock constructor that returns a new instance of ErrorClass
|
|
143
|
+
const mockConstructor = _createJaypieMock(function (...args) {
|
|
144
|
+
return new ErrorClass(...args);
|
|
145
|
+
});
|
|
146
|
+
return mockConstructor;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
150
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
151
|
+
// Constants for mock values
|
|
152
|
+
const TAG$4 = "AWS";
|
|
153
|
+
const getMessages = createMockWrappedFunction(original.getMessages, []);
|
|
154
|
+
const getSecret = createMockResolvedFunction("mock-secret-value");
|
|
155
|
+
const sendMessage = createMockResolvedFunction({
|
|
156
|
+
MessageId: "mock-message-id",
|
|
157
|
+
});
|
|
158
|
+
// Add missing functions from original implementation
|
|
159
|
+
const getEnvSecret = createMockFunction(async (key) => `_MOCK_ENV_SECRET_[${TAG$4}][${key}]`);
|
|
160
|
+
const getSingletonMessage = createMockWrappedFunction(original.getSingletonMessage, { value: "_MOCK_SINGLETON_MESSAGE_" });
|
|
161
|
+
const getTextractJob = createMockFunction(async (job) => ({ value: `_MOCK_TEXTRACT_JOB_[${job}]` }));
|
|
162
|
+
const sendBatchMessages = createMockResolvedFunction(true);
|
|
163
|
+
const sendTextractJob = createMockFunction(async ({ bucket, key, featureTypes = [] }) => {
|
|
164
|
+
// Basic validation to mimic original behavior
|
|
165
|
+
if (!bucket || !key) {
|
|
166
|
+
throw new Error("Bucket and key are required");
|
|
167
|
+
}
|
|
168
|
+
return [`_MOCK_TEXTRACT_JOB_ID_[${TAG$4}]_${bucket}_${key}`];
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
var aws = /*#__PURE__*/Object.freeze({
|
|
172
|
+
__proto__: null,
|
|
173
|
+
getEnvSecret: getEnvSecret,
|
|
174
|
+
getMessages: getMessages,
|
|
175
|
+
getSecret: getSecret,
|
|
176
|
+
getSingletonMessage: getSingletonMessage,
|
|
177
|
+
getTextractJob: getTextractJob,
|
|
178
|
+
sendBatchMessages: sendBatchMessages,
|
|
179
|
+
sendMessage: sendMessage,
|
|
180
|
+
sendTextractJob: sendTextractJob
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
function mockLogFactory() {
|
|
184
|
+
// Create skeleton of mock objects
|
|
185
|
+
const mock = {
|
|
186
|
+
debug: vi.fn(),
|
|
187
|
+
error: vi.fn(),
|
|
188
|
+
fatal: vi.fn(),
|
|
189
|
+
info: vi.fn(),
|
|
190
|
+
init: vi.fn(),
|
|
191
|
+
lib: vi.fn(),
|
|
192
|
+
tag: vi.fn(),
|
|
193
|
+
trace: vi.fn(),
|
|
194
|
+
untag: vi.fn(),
|
|
195
|
+
var: vi.fn(),
|
|
196
|
+
warn: vi.fn(),
|
|
197
|
+
with: vi.fn(),
|
|
198
|
+
};
|
|
199
|
+
// Fill out nested mocks
|
|
200
|
+
mock.debug.var = mock.var;
|
|
201
|
+
mock.error.var = mock.var;
|
|
202
|
+
mock.fatal.var = mock.var;
|
|
203
|
+
mock.info.var = mock.var;
|
|
204
|
+
mock.trace.var = mock.var;
|
|
205
|
+
mock.warn.var = mock.var;
|
|
206
|
+
// Have modules return correct objects
|
|
207
|
+
mock.init.mockReturnValue(null);
|
|
208
|
+
mock.lib.mockReturnValue(mock);
|
|
209
|
+
mock.with.mockReturnValue(mock);
|
|
210
|
+
// Pin mocks to the module
|
|
211
|
+
mock.mock = {
|
|
212
|
+
debug: mock.debug,
|
|
213
|
+
error: mock.error,
|
|
214
|
+
fatal: mock.fatal,
|
|
215
|
+
info: mock.info,
|
|
216
|
+
init: mock.init,
|
|
217
|
+
lib: mock.lib,
|
|
218
|
+
tag: mock.tag,
|
|
219
|
+
trace: mock.trace,
|
|
220
|
+
untag: mock.untag,
|
|
221
|
+
var: mock.var,
|
|
222
|
+
warn: mock.warn,
|
|
223
|
+
with: mock.with,
|
|
224
|
+
};
|
|
225
|
+
return mock;
|
|
226
|
+
}
|
|
227
|
+
const LOG_METHOD_NAMES = [
|
|
228
|
+
"debug",
|
|
229
|
+
"error",
|
|
230
|
+
"fatal",
|
|
231
|
+
"info",
|
|
232
|
+
"init",
|
|
233
|
+
"lib",
|
|
234
|
+
"tag",
|
|
235
|
+
"trace",
|
|
236
|
+
"untag",
|
|
237
|
+
"var",
|
|
238
|
+
"warn",
|
|
239
|
+
"with",
|
|
240
|
+
];
|
|
241
|
+
// Use Record type for more flexible access pattern
|
|
242
|
+
const originalLogMethods = new WeakMap();
|
|
243
|
+
function spyLog(logInstance) {
|
|
244
|
+
if (!originalLogMethods.has(logInstance)) {
|
|
245
|
+
const mockLog = mockLogFactory();
|
|
246
|
+
const originalMethods = {};
|
|
247
|
+
// Save only methods that actually exist on the log instance
|
|
248
|
+
LOG_METHOD_NAMES.forEach((method) => {
|
|
249
|
+
if (method in logInstance) {
|
|
250
|
+
originalMethods[method] =
|
|
251
|
+
logInstance[method];
|
|
252
|
+
// Use type assertion after checking existence
|
|
253
|
+
logInstance[method] = mockLog[method];
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
originalLogMethods.set(logInstance, originalMethods);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
261
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
262
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
263
|
+
// Constants for mock values
|
|
264
|
+
const TAG$3 = "CORE";
|
|
265
|
+
const BadGatewayError = createMockError(original$1.BadGatewayError);
|
|
266
|
+
const BadRequestError = createMockError(original$1.BadRequestError);
|
|
267
|
+
const ConfigurationError = createMockError(original$1.ConfigurationError);
|
|
268
|
+
const ForbiddenError = createMockError(original$1.ForbiddenError);
|
|
269
|
+
const GatewayTimeoutError = createMockError(original$1.GatewayTimeoutError);
|
|
270
|
+
const GoneError = createMockError(original$1.GoneError);
|
|
271
|
+
const IllogicalError = createMockError(original$1.IllogicalError);
|
|
272
|
+
const InternalError = createMockError(original$1.InternalError);
|
|
273
|
+
const MethodNotAllowedError = createMockError(original$1.MethodNotAllowedError);
|
|
274
|
+
const MultiError = createMockError(original$1.MultiError);
|
|
275
|
+
const NotFoundError = createMockError(original$1.NotFoundError);
|
|
276
|
+
const NotImplementedError = createMockError(original$1.NotImplementedError);
|
|
277
|
+
const ProjectError = createMockError(original$1.ProjectError);
|
|
278
|
+
const ProjectMultiError = createMockError(original$1.ProjectMultiError);
|
|
279
|
+
const RejectedError = createMockError(original$1.RejectedError);
|
|
280
|
+
const TeapotError = createMockError(original$1.TeapotError);
|
|
281
|
+
const UnauthorizedError = createMockError(original$1.UnauthorizedError);
|
|
282
|
+
const UnavailableError = createMockError(original$1.UnavailableError);
|
|
283
|
+
const UnhandledError = createMockError(original$1.UnhandledError);
|
|
284
|
+
const UnreachableCodeError = createMockError(original$1.UnreachableCodeError);
|
|
285
|
+
// Mock core functions
|
|
286
|
+
const validate = createMockWrappedObject(original$1.validate, {
|
|
287
|
+
fallback: false,
|
|
288
|
+
throws: true,
|
|
289
|
+
});
|
|
290
|
+
beforeAll(async () => {
|
|
291
|
+
spyLog(log);
|
|
292
|
+
});
|
|
293
|
+
// Add missing core functions
|
|
294
|
+
const cloneDeep = createMockWrappedFunction(original$1.cloneDeep, {
|
|
295
|
+
throws: true,
|
|
296
|
+
});
|
|
297
|
+
const envBoolean = createMockReturnedFunction(true);
|
|
298
|
+
const envsKey = createMockWrappedFunction(original$1.envsKey, `_MOCK_ENVS_KEY_[${TAG$3}]`);
|
|
299
|
+
const errorFromStatusCode = createMockFunction((statusCode, message = `Mock error for status code ${statusCode}`) => {
|
|
300
|
+
try {
|
|
301
|
+
// Try to mimic original implementation
|
|
302
|
+
switch (statusCode) {
|
|
303
|
+
case 400:
|
|
304
|
+
return new BadRequestError(message);
|
|
305
|
+
case 401:
|
|
306
|
+
return new UnauthorizedError(message);
|
|
307
|
+
case 403:
|
|
308
|
+
return new ForbiddenError(message);
|
|
309
|
+
case 404:
|
|
310
|
+
return new NotFoundError(message);
|
|
311
|
+
case 405:
|
|
312
|
+
return new MethodNotAllowedError(message);
|
|
313
|
+
case 410:
|
|
314
|
+
return new GoneError(message);
|
|
315
|
+
case 418:
|
|
316
|
+
return new TeapotError(message);
|
|
317
|
+
case 500:
|
|
318
|
+
return new InternalError(message);
|
|
319
|
+
case 501:
|
|
320
|
+
return new NotImplementedError(message);
|
|
321
|
+
case 502:
|
|
322
|
+
return new BadGatewayError(message);
|
|
323
|
+
case 503:
|
|
324
|
+
return new UnavailableError(message);
|
|
325
|
+
case 504:
|
|
326
|
+
return new GatewayTimeoutError(message);
|
|
327
|
+
default:
|
|
328
|
+
return new Error(message);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
return new Error(`_MOCK_ERROR_FROM_STATUS_CODE_[${TAG$3}][${statusCode}]`);
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
const formatError = createMockWrappedFunction(original$1.formatError, `_MOCK_FORMAT_ERROR_[${TAG$3}]`);
|
|
336
|
+
const getHeaderFrom = createMockWrappedFunction(original$1.getHeaderFrom, `_MOCK_GET_HEADER_FROM_[${TAG$3}]`);
|
|
337
|
+
const getObjectKeyCaseInsensitive = createMockWrappedFunction(original$1.getObjectKeyCaseInsensitive, `_MOCK_GET_OBJECT_KEY_CASE_INSENSITIVE_[${TAG$3}]`);
|
|
338
|
+
const isClass = createMockWrappedFunction(original$1.isClass, `_MOCK_IS_CLASS_[${TAG$3}]`);
|
|
339
|
+
const isJaypieError = createMockWrappedFunction(original$1.isJaypieError, false);
|
|
340
|
+
// Optional/Required validation functions
|
|
341
|
+
const optional = createMockWrappedObject(original$1.optional, {
|
|
342
|
+
fallback: true,
|
|
343
|
+
throws: true,
|
|
344
|
+
});
|
|
345
|
+
const required = createMockWrappedObject(original$1.required, {
|
|
346
|
+
fallback: true,
|
|
347
|
+
throws: true,
|
|
348
|
+
});
|
|
349
|
+
const safeParseFloat = createMockWrappedFunction(original$1.safeParseFloat, `_MOCK_SAFE_PARSE_FLOAT_[${TAG$3}]`);
|
|
350
|
+
const placeholders = createMockWrappedFunction(original$1.placeholders, `_MOCK_PLACEHOLDERS_[${TAG$3}]`);
|
|
351
|
+
// Add force utilities to help with jaypieHandler implementation
|
|
352
|
+
const force = createMockWrappedObject(original$1.force);
|
|
353
|
+
const jaypieHandler = createMockFunction((handler, options = {}) => {
|
|
354
|
+
return async (...args) => {
|
|
355
|
+
let result;
|
|
356
|
+
let thrownError;
|
|
357
|
+
// Destructure options with defaults
|
|
358
|
+
const { setup = [], teardown = [], unavailable = original$1.force.boolean(process.env.PROJECT_UNAVAILABLE), validate = [], } = options;
|
|
359
|
+
// Check if service is unavailable
|
|
360
|
+
if (unavailable)
|
|
361
|
+
throw new UnavailableError("Service unavailable");
|
|
362
|
+
// Run validation functions
|
|
363
|
+
const validateFunctions = original$1.force.array(validate);
|
|
364
|
+
for (const validator of validateFunctions) {
|
|
365
|
+
if (typeof validator === "function") {
|
|
366
|
+
const valid = await validator(...args);
|
|
367
|
+
if (valid === false) {
|
|
368
|
+
throw new BadRequestError("Validation failed");
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
try {
|
|
373
|
+
// Run setup functions
|
|
374
|
+
const setupFunctions = original$1.force.array(setup);
|
|
375
|
+
for (const setupFunction of setupFunctions) {
|
|
376
|
+
if (typeof setupFunction === "function") {
|
|
377
|
+
await setupFunction(...args);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
// Execute the handler
|
|
381
|
+
result = await handler(...args);
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
thrownError = error;
|
|
385
|
+
}
|
|
386
|
+
// Run teardown functions (always run even if there was an error)
|
|
387
|
+
const teardownFunctions = original$1.force.array(teardown);
|
|
388
|
+
for (const teardownFunction of teardownFunctions) {
|
|
389
|
+
if (typeof teardownFunction === "function") {
|
|
390
|
+
try {
|
|
391
|
+
await teardownFunction(...args);
|
|
392
|
+
}
|
|
393
|
+
catch (error) {
|
|
394
|
+
// Swallow teardown errors, but log them
|
|
395
|
+
console.error(error);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
// If there was an error in the handler, throw it after teardown
|
|
400
|
+
if (thrownError) {
|
|
401
|
+
throw thrownError;
|
|
402
|
+
}
|
|
403
|
+
return result;
|
|
404
|
+
};
|
|
405
|
+
});
|
|
406
|
+
const sleep = createMockResolvedFunction(true);
|
|
407
|
+
const uuid = createMockWrappedFunction(original$1.uuid, `00000000-0000-0000-0000-000000000000`);
|
|
408
|
+
const ERROR = original$1.ERROR;
|
|
409
|
+
const HTTP$1 = original$1.HTTP;
|
|
410
|
+
const JAYPIE = original$1.JAYPIE;
|
|
411
|
+
const PROJECT = original$1.PROJECT;
|
|
412
|
+
const VALIDATE = original$1.VALIDATE;
|
|
413
|
+
|
|
414
|
+
var core = /*#__PURE__*/Object.freeze({
|
|
415
|
+
__proto__: null,
|
|
416
|
+
BadGatewayError: BadGatewayError,
|
|
417
|
+
BadRequestError: BadRequestError,
|
|
418
|
+
ConfigurationError: ConfigurationError,
|
|
419
|
+
ERROR: ERROR,
|
|
420
|
+
ForbiddenError: ForbiddenError,
|
|
421
|
+
GatewayTimeoutError: GatewayTimeoutError,
|
|
422
|
+
GoneError: GoneError,
|
|
423
|
+
HTTP: HTTP$1,
|
|
424
|
+
IllogicalError: IllogicalError,
|
|
425
|
+
InternalError: InternalError,
|
|
426
|
+
JAYPIE: JAYPIE,
|
|
427
|
+
MethodNotAllowedError: MethodNotAllowedError,
|
|
428
|
+
MultiError: MultiError,
|
|
429
|
+
NotFoundError: NotFoundError,
|
|
430
|
+
NotImplementedError: NotImplementedError,
|
|
431
|
+
PROJECT: PROJECT,
|
|
432
|
+
ProjectError: ProjectError,
|
|
433
|
+
ProjectMultiError: ProjectMultiError,
|
|
434
|
+
RejectedError: RejectedError,
|
|
435
|
+
TeapotError: TeapotError,
|
|
436
|
+
UnauthorizedError: UnauthorizedError,
|
|
437
|
+
UnavailableError: UnavailableError,
|
|
438
|
+
UnhandledError: UnhandledError,
|
|
439
|
+
UnreachableCodeError: UnreachableCodeError,
|
|
440
|
+
VALIDATE: VALIDATE,
|
|
441
|
+
cloneDeep: cloneDeep,
|
|
442
|
+
envBoolean: envBoolean,
|
|
443
|
+
envsKey: envsKey,
|
|
444
|
+
errorFromStatusCode: errorFromStatusCode,
|
|
445
|
+
force: force,
|
|
446
|
+
formatError: formatError,
|
|
447
|
+
getHeaderFrom: getHeaderFrom,
|
|
448
|
+
getObjectKeyCaseInsensitive: getObjectKeyCaseInsensitive,
|
|
449
|
+
isClass: isClass,
|
|
450
|
+
isJaypieError: isJaypieError,
|
|
451
|
+
jaypieHandler: jaypieHandler,
|
|
452
|
+
log: log,
|
|
453
|
+
optional: optional,
|
|
454
|
+
placeholders: placeholders,
|
|
455
|
+
required: required,
|
|
456
|
+
safeParseFloat: safeParseFloat,
|
|
457
|
+
sleep: sleep,
|
|
458
|
+
uuid: uuid,
|
|
459
|
+
validate: validate
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
const DATADOG = original$2.DATADOG;
|
|
463
|
+
const submitMetric = createMockResolvedFunction(true);
|
|
464
|
+
const submitMetricSet = createMockResolvedFunction(true);
|
|
465
|
+
|
|
466
|
+
var datadog = /*#__PURE__*/Object.freeze({
|
|
467
|
+
__proto__: null,
|
|
468
|
+
DATADOG: DATADOG,
|
|
469
|
+
submitMetric: submitMetric,
|
|
470
|
+
submitMetricSet: submitMetricSet
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
474
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
475
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
476
|
+
// Constants for mock values
|
|
477
|
+
const TAG$2 = "EXPRESS";
|
|
478
|
+
const HTTP = {
|
|
479
|
+
CODE: { OK: 200, CREATED: 201, NO_CONTENT: 204, INTERNAL_ERROR: 500 },
|
|
480
|
+
};
|
|
481
|
+
const EXPRESS = original$3.EXPRESS;
|
|
482
|
+
// Add Express route functions
|
|
483
|
+
const badRequestRoute = createMockWrappedFunction(original$3.badRequestRoute, { error: `_MOCK_BAD_REQUEST_ROUTE_[${TAG$2}]` });
|
|
484
|
+
const echoRoute = createMockWrappedFunction(original$3.echoRoute, (req) => req);
|
|
485
|
+
const forbiddenRoute = createMockWrappedFunction(original$3.forbiddenRoute, { error: `_MOCK_FORBIDDEN_ROUTE_[${TAG$2}]` });
|
|
486
|
+
const goneRoute = createMockWrappedFunction(original$3.goneRoute, {
|
|
487
|
+
error: `_MOCK_GONE_ROUTE_[${TAG$2}]`,
|
|
488
|
+
});
|
|
489
|
+
const methodNotAllowedRoute = createMockWrappedFunction(original$3.methodNotAllowedRoute, { error: `_MOCK_METHOD_NOT_ALLOWED_ROUTE_[${TAG$2}]` });
|
|
490
|
+
const noContentRoute = createMockWrappedFunction(original$3.noContentRoute, { status: 204 });
|
|
491
|
+
const notFoundRoute = createMockWrappedFunction(original$3.notFoundRoute, {
|
|
492
|
+
error: `_MOCK_NOT_FOUND_ROUTE_[${TAG$2}]`,
|
|
493
|
+
});
|
|
494
|
+
const notImplementedRoute = createMockWrappedFunction(original$3.notImplementedRoute, { error: `_MOCK_NOT_IMPLEMENTED_ROUTE_[${TAG$2}]` });
|
|
495
|
+
const expressHttpCodeHandler = createMockWrappedFunction(original$3.expressHttpCodeHandler, (...args) => {
|
|
496
|
+
const [req, res, next] = args;
|
|
497
|
+
return res.status(200).send();
|
|
498
|
+
});
|
|
499
|
+
const cors = createMockWrappedFunction(original$3.cors);
|
|
500
|
+
const expressHandler = createMockFunction((handlerOrProps, propsOrHandler) => {
|
|
501
|
+
let handler;
|
|
502
|
+
let props;
|
|
503
|
+
if (typeof handlerOrProps === "object" &&
|
|
504
|
+
typeof propsOrHandler === "function") {
|
|
505
|
+
handler = propsOrHandler;
|
|
506
|
+
props = handlerOrProps;
|
|
507
|
+
}
|
|
508
|
+
else if (typeof handlerOrProps === "function") {
|
|
509
|
+
handler = handlerOrProps;
|
|
510
|
+
props = (propsOrHandler || {});
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
throw new BadRequestError$1("handler must be a function");
|
|
514
|
+
}
|
|
515
|
+
// Add locals setup if needed
|
|
516
|
+
if (props.locals &&
|
|
517
|
+
typeof props.locals === "object" &&
|
|
518
|
+
!Array.isArray(props.locals)) {
|
|
519
|
+
const keys = Object.keys(props.locals);
|
|
520
|
+
if (!props.setup)
|
|
521
|
+
props.setup = [];
|
|
522
|
+
props.setup = force.array(props.setup);
|
|
523
|
+
// @ts-expect-error TODO: cannot resolve; fix when JaypieHandler moves to TypeScript
|
|
524
|
+
props.setup.unshift((req) => {
|
|
525
|
+
if (!req || typeof req !== "object") {
|
|
526
|
+
throw new BadRequestError$1("req must be an object");
|
|
527
|
+
}
|
|
528
|
+
// Set req.locals if it doesn't exist
|
|
529
|
+
if (!req.locals)
|
|
530
|
+
req.locals = {};
|
|
531
|
+
if (typeof req.locals !== "object" || Array.isArray(req.locals)) {
|
|
532
|
+
throw new BadRequestError$1("req.locals must be an object");
|
|
533
|
+
}
|
|
534
|
+
if (!req.locals._jaypie)
|
|
535
|
+
req.locals._jaypie = {};
|
|
536
|
+
});
|
|
537
|
+
const localsSetup = async (localsReq, localsRes) => {
|
|
538
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
539
|
+
const key = keys[i];
|
|
540
|
+
if (typeof props.locals[key] === "function") {
|
|
541
|
+
localsReq.locals[key] = await props.locals[key](localsReq, localsRes);
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
localsReq.locals[key] = props.locals[key];
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
props.setup.push(localsSetup);
|
|
549
|
+
}
|
|
550
|
+
if (props.locals && typeof props.locals !== "object") {
|
|
551
|
+
throw new BadRequestError$1("props.locals must be an object");
|
|
552
|
+
}
|
|
553
|
+
if (props.locals && Array.isArray(props.locals)) {
|
|
554
|
+
throw new BadRequestError$1("props.locals must be an object");
|
|
555
|
+
}
|
|
556
|
+
if (props.locals === null) {
|
|
557
|
+
throw new BadRequestError$1("props.locals must be an object");
|
|
558
|
+
}
|
|
559
|
+
const jaypieFunction = jaypieHandler(handler, props);
|
|
560
|
+
return async (req = {}, res = {}, ...extra) => {
|
|
561
|
+
const status = HTTP.CODE.OK;
|
|
562
|
+
let response;
|
|
563
|
+
let supertestMode = false;
|
|
564
|
+
if (res &&
|
|
565
|
+
typeof res === "object" &&
|
|
566
|
+
"socket" in res &&
|
|
567
|
+
res.constructor.name === "ServerResponse") {
|
|
568
|
+
// Use the response object in supertest mode
|
|
569
|
+
supertestMode = true;
|
|
570
|
+
}
|
|
571
|
+
try {
|
|
572
|
+
response = await jaypieFunction(req, res, ...extra);
|
|
573
|
+
}
|
|
574
|
+
catch (error) {
|
|
575
|
+
// In the mock context, if status is a function we are in a "supertest"
|
|
576
|
+
if (supertestMode && typeof res.status === "function") {
|
|
577
|
+
// In theory jaypieFunction has handled all errors
|
|
578
|
+
const errorStatus = error.status || HTTP.CODE.INTERNAL_ERROR;
|
|
579
|
+
let errorResponse;
|
|
580
|
+
if (typeof error.json === "function") {
|
|
581
|
+
errorResponse = error.json();
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
// This should never happen
|
|
585
|
+
errorResponse = new UnhandledError$1().json();
|
|
586
|
+
}
|
|
587
|
+
res.status(errorStatus).json(errorResponse);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
// else, res.status is not a function, throw the error
|
|
592
|
+
throw error;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
if (supertestMode && typeof res.status === "function") {
|
|
596
|
+
if (response) {
|
|
597
|
+
if (typeof response === "object") {
|
|
598
|
+
if (typeof response.json === "function") {
|
|
599
|
+
res.json(response.json());
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
res.status(status).json(response);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
else if (typeof response === "string") {
|
|
606
|
+
try {
|
|
607
|
+
res.status(status).json(JSON.parse(response));
|
|
608
|
+
}
|
|
609
|
+
catch (error) {
|
|
610
|
+
res.status(status).send(response);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
else if (response === true) {
|
|
614
|
+
res.status(HTTP.CODE.CREATED).send();
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
res.status(status).send(response);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
res.status(HTTP.CODE.NO_CONTENT).send();
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
return response;
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
var express = /*#__PURE__*/Object.freeze({
|
|
631
|
+
__proto__: null,
|
|
632
|
+
EXPRESS: EXPRESS,
|
|
633
|
+
badRequestRoute: badRequestRoute,
|
|
634
|
+
cors: cors,
|
|
635
|
+
echoRoute: echoRoute,
|
|
636
|
+
expressHandler: expressHandler,
|
|
637
|
+
expressHttpCodeHandler: expressHttpCodeHandler,
|
|
638
|
+
forbiddenRoute: forbiddenRoute,
|
|
639
|
+
goneRoute: goneRoute,
|
|
640
|
+
methodNotAllowedRoute: methodNotAllowedRoute,
|
|
641
|
+
noContentRoute: noContentRoute,
|
|
642
|
+
notFoundRoute: notFoundRoute,
|
|
643
|
+
notImplementedRoute: notImplementedRoute
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
// Mock implementation of lambdaHandler that follows the original implementation pattern
|
|
647
|
+
const lambdaHandler = createMockFunction((handler, props = {}) => {
|
|
648
|
+
// If handler is an object and options is a function, swap them
|
|
649
|
+
if (typeof handler === "object" && typeof props === "function") {
|
|
650
|
+
const temp = handler;
|
|
651
|
+
handler = props;
|
|
652
|
+
props = temp;
|
|
653
|
+
}
|
|
654
|
+
return async (event, context, ...extra) => {
|
|
655
|
+
return jaypieHandler(handler, props)(event, context, ...extra);
|
|
656
|
+
};
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
var lambda = /*#__PURE__*/Object.freeze({
|
|
660
|
+
__proto__: null,
|
|
661
|
+
lambdaHandler: lambdaHandler
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
665
|
+
// Constants for mock values
|
|
666
|
+
const TAG$1 = "LLM";
|
|
667
|
+
const LLM = original$4.LLM;
|
|
668
|
+
const mockOperate = createMockResolvedFunction({
|
|
669
|
+
history: [
|
|
670
|
+
{
|
|
671
|
+
content: "_MOCK_USER_INPUT",
|
|
672
|
+
role: "user",
|
|
673
|
+
type: "message",
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
id: "_MOCK_MESSAGE_ID",
|
|
677
|
+
type: "message",
|
|
678
|
+
status: "completed",
|
|
679
|
+
content: "_MOCK_CONTENT",
|
|
680
|
+
role: "assistant",
|
|
681
|
+
},
|
|
682
|
+
],
|
|
683
|
+
output: [
|
|
684
|
+
{
|
|
685
|
+
id: "_MOCK_MESSAGE_ID",
|
|
686
|
+
type: "message",
|
|
687
|
+
status: "completed",
|
|
688
|
+
content: "_MOCK_CONTENT",
|
|
689
|
+
role: "assistant",
|
|
690
|
+
},
|
|
691
|
+
],
|
|
692
|
+
responses: [
|
|
693
|
+
{
|
|
694
|
+
id: "_MOCK_RESPONSE_ID",
|
|
695
|
+
object: "response",
|
|
696
|
+
created_at: Date.now() / 1000,
|
|
697
|
+
status: "completed",
|
|
698
|
+
error: null,
|
|
699
|
+
output_text: "_MOCK_OUTPUT_TEXT",
|
|
700
|
+
},
|
|
701
|
+
],
|
|
702
|
+
status: "completed",
|
|
703
|
+
usage: { input: 100, output: 20, reasoning: 0, total: 120 },
|
|
704
|
+
content: "_MOCK_OUTPUT_TEXT",
|
|
705
|
+
});
|
|
706
|
+
const mockSend = createMockResolvedFunction("_MOCK_LLM_RESPONSE");
|
|
707
|
+
const Llm = Object.assign(vi.fn().mockImplementation((providerName = "_MOCK_LLM_PROVIDER") => ({
|
|
708
|
+
_provider: providerName,
|
|
709
|
+
_llm: {
|
|
710
|
+
operate: mockOperate,
|
|
711
|
+
send: mockSend,
|
|
712
|
+
},
|
|
713
|
+
operate: mockOperate,
|
|
714
|
+
send: mockSend,
|
|
715
|
+
})), {
|
|
716
|
+
operate: mockOperate,
|
|
717
|
+
send: mockSend,
|
|
718
|
+
});
|
|
719
|
+
// Tool implementations - always return mock values
|
|
720
|
+
const random = createMockReturnedFunction(0.5);
|
|
721
|
+
const roll = createMockReturnedFunction(6);
|
|
722
|
+
const time = createMockReturnedFunction(`_MOCK_TIME_[${TAG$1}]`);
|
|
723
|
+
const weather = createMockResolvedFunction({
|
|
724
|
+
location: `_MOCK_WEATHER_LOCATION_[${TAG$1}]`,
|
|
725
|
+
forecast: Array(7)
|
|
726
|
+
.fill(0)
|
|
727
|
+
.map((_, i) => ({
|
|
728
|
+
date: `2025-05-${i + 1}`,
|
|
729
|
+
temperature: 72,
|
|
730
|
+
condition: "Sunny",
|
|
731
|
+
precipitation: 0,
|
|
732
|
+
})),
|
|
733
|
+
});
|
|
734
|
+
// Tool collections
|
|
735
|
+
const toolkit = {
|
|
736
|
+
random,
|
|
737
|
+
roll,
|
|
738
|
+
time,
|
|
739
|
+
weather,
|
|
740
|
+
};
|
|
741
|
+
const tools = Object.values(toolkit);
|
|
742
|
+
|
|
743
|
+
var llm = /*#__PURE__*/Object.freeze({
|
|
744
|
+
__proto__: null,
|
|
745
|
+
LLM: LLM,
|
|
746
|
+
Llm: Llm,
|
|
747
|
+
toolkit: toolkit,
|
|
748
|
+
tools: tools
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
// Mongoose mock functions
|
|
752
|
+
const connect = createMockReturnedFunction(true);
|
|
753
|
+
const connectFromSecretEnv = createMockReturnedFunction(true);
|
|
754
|
+
const disconnect = createMockReturnedFunction(true);
|
|
755
|
+
|
|
756
|
+
var mongoose = /*#__PURE__*/Object.freeze({
|
|
757
|
+
__proto__: null,
|
|
758
|
+
connect: connect,
|
|
759
|
+
connectFromSecretEnv: connectFromSecretEnv,
|
|
760
|
+
disconnect: disconnect,
|
|
761
|
+
mongoose: mongoose$1
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
765
|
+
// Constants for mock values
|
|
766
|
+
const TAG = "TEXTRACT";
|
|
767
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
768
|
+
const __dirname = dirname(__filename);
|
|
769
|
+
const MOCK_TEXTRACT_DOCUMENT_PATH = join(__dirname, "..", "mockTextract.json");
|
|
770
|
+
// Setup
|
|
771
|
+
let mockTextractContents;
|
|
772
|
+
beforeAll(async () => {
|
|
773
|
+
mockTextractContents = await readFile(MOCK_TEXTRACT_DOCUMENT_PATH, "utf-8");
|
|
774
|
+
});
|
|
775
|
+
/**
|
|
776
|
+
* Mock for MarkdownPage class from @jaypie/textract
|
|
777
|
+
*/
|
|
778
|
+
const MarkdownPage = createMockWrappedObject(original$5.MarkdownPage, {
|
|
779
|
+
class: true,
|
|
780
|
+
fallback: () => {
|
|
781
|
+
const mockDocument = new TextractDocument(JSON.parse(mockTextractContents));
|
|
782
|
+
// Double type assertion needed to bridge incompatible types
|
|
783
|
+
return new original$5.MarkdownPage(mockDocument.pageNumber(1));
|
|
784
|
+
},
|
|
785
|
+
});
|
|
786
|
+
/**
|
|
787
|
+
* Mock for textractJsonToMarkdown function from @jaypie/textract
|
|
788
|
+
*/
|
|
789
|
+
const textractJsonToMarkdown = createMockWrappedFunction(original$5.textractJsonToMarkdown, `_MOCK_TEXTRACT_JSON_TO_MARKDOWN_[${TAG}]`);
|
|
790
|
+
// Export default for convenience
|
|
791
|
+
var textract = {
|
|
792
|
+
MarkdownPage,
|
|
793
|
+
textractJsonToMarkdown,
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
var textract$1 = /*#__PURE__*/Object.freeze({
|
|
797
|
+
__proto__: null,
|
|
798
|
+
MarkdownPage: MarkdownPage,
|
|
799
|
+
default: textract,
|
|
800
|
+
textractJsonToMarkdown: textractJsonToMarkdown
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
// Import all mocks
|
|
804
|
+
// Export default object with all mocks
|
|
805
|
+
var index = {
|
|
806
|
+
// AWS module
|
|
807
|
+
...aws,
|
|
808
|
+
// Core module
|
|
809
|
+
...core,
|
|
810
|
+
// Datadog module
|
|
811
|
+
...datadog,
|
|
812
|
+
// Express module
|
|
813
|
+
...express,
|
|
814
|
+
// Lambda module
|
|
815
|
+
...lambda,
|
|
816
|
+
// LLM module
|
|
817
|
+
...llm,
|
|
818
|
+
// Mongoose module (now empty)
|
|
819
|
+
...mongoose,
|
|
820
|
+
// Textract module
|
|
821
|
+
...textract$1,
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
export { BadGatewayError, BadRequestError, ConfigurationError, DATADOG, ERROR, EXPRESS, ForbiddenError, GatewayTimeoutError, GoneError, HTTP$1 as HTTP, IllogicalError, InternalError, JAYPIE, LLM, Llm, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, PROJECT, ProjectError, ProjectMultiError, RejectedError, TeapotError, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, VALIDATE, badRequestRoute, cloneDeep, connect, connectFromSecretEnv, cors, index as default, disconnect, echoRoute, envBoolean, envsKey, errorFromStatusCode, expressHandler, expressHttpCodeHandler, forbiddenRoute, force, formatError, getEnvSecret, getHeaderFrom, getMessages, getObjectKeyCaseInsensitive, getSecret, getSingletonMessage, getTextractJob, goneRoute, isClass, isJaypieError, jaypieHandler, lambdaHandler, methodNotAllowedRoute, noContentRoute, notFoundRoute, notImplementedRoute, optional, placeholders, required, safeParseFloat, sendBatchMessages, sendMessage, sendTextractJob, sleep, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, uuid, validate };
|
|
825
|
+
//# sourceMappingURL=index.js.map
|