@jaypie/testkit 1.1.27 → 1.1.29

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.js CHANGED
@@ -79,7 +79,6 @@ const calledAboveTrace = (log) => {
79
79
  pass: true,
80
80
  };
81
81
  }
82
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
83
82
  }
84
83
  catch (error) {
85
84
  throw Error(`[calledAboveTrace] log is not a mock object`);
@@ -136,10 +135,8 @@ const toBeClass = (received) => {
136
135
  let pass = false;
137
136
  if (typeof received === "function") {
138
137
  try {
139
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
140
138
  new received();
141
139
  pass = true;
142
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
143
140
  }
144
141
  catch (error) {
145
142
  pass = false;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/constants.ts","../src/jsonApiSchema.module.ts","../src/matchers/toBeCalledAboveTrace.matcher.ts","../src/matchers/toBeCalledWithInitialParams.matcher.ts","../src/matchers/toBeClass.matcher.ts","../src/matchers/toBeJaypieError.matcher.ts","../src/matchers/toBeMockFunction.matcher.ts","../src/matchers/toMatch.matcher.ts","../src/matchers/toThrowError.matcher.ts","../src/matchers/toThrowJaypieError.matcher.ts","../src/matchers.module.ts","../src/mockLog.module.ts","../src/sqsTestRecords.function.ts"],"sourcesContent":["export const LOG = {\n LEVEL: {\n ALL: \"all\",\n DEBUG: \"debug\",\n ERROR: \"error\",\n FATAL: \"fatal\",\n INFO: \"info\",\n SILENT: \"silent\",\n TRACE: \"trace\",\n WARN: \"warn\",\n },\n} as const;\n\nexport const RE_BASE64_PATTERN = /^[a-zA-Z0-9\\\\+\\\\/]+$/;\nexport const RE_JWT_PATTERN = /^([^.]+)\\.([^.]+)\\.([^.]+)$/;\nexport const RE_MONGO_ID_PATTERN = /^[a-f0-9]{24}$/i;\nexport const RE_SIGNED_COOKIE_PATTERN = /^s:([^.]+)\\.([^.]+)$/;\nexport const RE_UUID_4_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_5_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?5[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\n","import { JsonApiData, JsonApiError } from \"./types/jaypie-testkit\";\n\nexport const jsonApiErrorSchema = {\n type: \"object\",\n properties: {\n errors: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n status: { type: \"number\" },\n title: { type: \"string\" },\n detail: { type: \"string\" },\n },\n required: [\"status\", \"title\"],\n },\n minItems: 1,\n },\n },\n required: [\"errors\"],\n} as const;\n\nexport const jsonApiSchema = {\n type: \"object\",\n properties: {\n data: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n type: { type: \"string\" },\n attributes: { type: \"object\" },\n links: { type: \"object\" },\n meta: { type: \"object\" },\n relationships: { type: \"object\" },\n },\n required: [\"id\", \"type\"],\n },\n meta: { type: \"object\" },\n },\n required: [\"data\"],\n} as const;\n\n// Type guards\nexport const isJsonApiError = (obj: unknown): obj is JsonApiError => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"errors\" in obj && Array.isArray((obj as JsonApiError).errors);\n};\n\nexport const isJsonApiData = (obj: unknown): obj is JsonApiData => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"data\" in obj && typeof (obj as JsonApiData).data === \"object\";\n};\n","import { LogMock, MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst calledAboveTrace = (log: LogMock): MatcherResult => {\n try {\n if (\n log.debug.mock.calls.length > 0 ||\n log.info.mock.calls.length > 0 ||\n log.warn.mock.calls.length > 0 ||\n log.error.mock.calls.length > 0 ||\n log.fatal.mock.calls.length > 0\n ) {\n return {\n message: () => `expected log not to have been called above trace`,\n pass: true,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n throw Error(`[calledAboveTrace] log is not a mock object`);\n }\n\n return {\n message: () => `expected log not to have been called above trace`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default calledAboveTrace;\n","import { isDeepStrictEqual as isEqual } from \"node:util\";\nimport { Mock } from \"vitest\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeCalledWithInitialParams = (\n received: Mock,\n ...passed: unknown[]\n): MatcherResult => {\n let pass: boolean | undefined;\n\n if (!received || typeof received !== \"function\" || !received.mock) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected a mock function`,\n pass: false,\n };\n }\n\n received.mock.calls.forEach((call: unknown[]) => {\n if (call.length >= passed.length) {\n let matching = true;\n for (let i = 0; i < passed.length && matching; i += 1) {\n if (!isEqual(passed[i], call[i])) matching = false;\n }\n pass = pass || matching;\n }\n });\n\n if (pass === undefined) pass = false;\n\n if (pass) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected call beginning with [${passed},...]`,\n pass: true,\n };\n } else {\n return {\n message: () =>\n `Expectation \\`not.toBeCalledWithInitialParams\\` did not expect call beginning with [${passed},...]`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeCalledWithInitialParams;\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeClass = (received: unknown): MatcherResult => {\n let pass = false;\n if (typeof received === \"function\") {\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (received as any)();\n pass = true;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n pass = false;\n }\n }\n if (pass) {\n return {\n message: () => `expected ${received} not to be a class`,\n pass: true,\n };\n }\n return {\n message: () => `expected ${received} to be a class`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default toBeClass;\n","import { matchers as jsonSchemaMatchers } from \"jest-json-schema\";\nimport { jsonApiErrorSchema } from \"../jsonApiSchema.module\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper Functions\n//\n\nfunction isErrorObjectJaypieError(error: Error): MatcherResult {\n if (\"isProjectError\" in error) {\n return {\n message: () => `expected \"${error}\" not to be a Jaypie error`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${error}\" to be a Jaypie error`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nconst toBeJaypieError = (received: unknown): MatcherResult => {\n // See if it is an instance of error:\n if (received instanceof Error) {\n return isErrorObjectJaypieError(received);\n }\n\n const result = jsonSchemaMatchers.toMatchSchema(received, jsonApiErrorSchema);\n if (result.pass) {\n return {\n message: () => `expected ${received} not to be a Jaypie error`,\n pass: true,\n };\n } else {\n return {\n message: () => `expected ${received} to be a Jaypie error`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeJaypieError;\n","import { vi } from \"vitest\";\nimport type { Assertion } from \"vitest\";\n\ndeclare module \"vitest\" {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n interface Assertion<T = any> {\n toBeMockFunction(): T;\n }\n}\n\nexport function toBeMockFunction(this: Assertion, received: unknown) {\n const { equals, utils } = this;\n const pass = typeof received === \"function\" && vi.isMockFunction(received);\n\n return {\n message: () =>\n `expected ${utils.printReceived(received)} ${\n pass ? \"not \" : \"\"\n }to be a mock function`,\n pass,\n };\n}\n","import {\n RE_BASE64_PATTERN,\n RE_JWT_PATTERN,\n RE_MONGO_ID_PATTERN,\n RE_SIGNED_COOKIE_PATTERN,\n RE_UUID_4_PATTERN,\n RE_UUID_5_PATTERN,\n RE_UUID_PATTERN,\n} from \"../constants.js\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper\n//\n\ninterface ForSubjectToMatchPatternOptions {\n patternName?: string;\n}\n\nfunction forSubjectToMatchPattern(\n subject: string,\n pattern: RegExp,\n { patternName = \"pattern\" }: ForSubjectToMatchPatternOptions = {},\n): MatcherResult {\n if (pattern.test(subject)) {\n return {\n message: () => `expected \"${subject}\" not to match ${patternName}`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${subject}\" to match ${patternName}`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nexport const toMatchBase64 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_BASE64_PATTERN, {\n patternName: \"Base64\",\n });\n\nexport const toMatchJwt = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_JWT_PATTERN, {\n patternName: \"JWT\",\n });\n\nexport const toMatchMongoId = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_MONGO_ID_PATTERN, {\n patternName: \"MongoDbId\",\n });\n\nexport const toMatchSignedCookie = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_SIGNED_COOKIE_PATTERN, {\n patternName: \"Signed-Cookie\",\n });\n\nexport const toMatchUuid4 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_4_PATTERN, {\n patternName: \"UUIDv4\",\n });\n\nexport const toMatchUuid5 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_5_PATTERN, {\n patternName: \"UUIDv5\",\n });\n\n/**\n * Determines if subject matches a UUID pattern.\n * Does _NOT_ check if the UUID is valid.\n */\nexport const toMatchUuid = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_PATTERN, {\n patternName: \"UUID\",\n });\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\n\nconst toThrowError = async (\n received: ReceivedFunction,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n return {\n pass: false,\n message: () =>\n \"Expected function to throw an error, but it did not throw.\",\n };\n } catch (error) {\n return {\n pass: true,\n message: () =>\n `Expected function not to throw an error, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toThrowError;\n","import {\n BadGatewayError,\n BadRequestError,\n ConfigurationError,\n ForbiddenError,\n GatewayTimeoutError,\n InternalError,\n isJaypieError,\n NotFoundError,\n ProjectError,\n UnauthorizedError,\n UnavailableError,\n} from \"@jaypie/core\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n// Define a more specific type for ProjectError with _type field\ntype JaypieErrorWithType = ProjectError & { _type: string };\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\ntype ErrorConstructor = new () => ProjectError;\n\nfunction isErrorConstructor(value: unknown): value is ErrorConstructor {\n return typeof value === \"function\" && \"prototype\" in value;\n}\n\nconst toThrowJaypieError = async (\n received: ReceivedFunction,\n expected?: ProjectError | (() => ProjectError) | ErrorConstructor,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n let expectedError: ProjectError | undefined = undefined;\n\n // Handle constructor, function, or instance\n if (typeof expected === \"function\") {\n if (isErrorConstructor(expected)) {\n // It's a constructor\n expectedError = new expected();\n } else {\n // It's a regular function\n expectedError = expected();\n }\n } else if (expected) {\n // It's an instance\n expectedError = expected;\n }\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n // If no error is thrown, fail the test\n return {\n pass: false,\n message: () =>\n \"Expected function to throw a JaypieError, but it did not throw.\",\n };\n } catch (error) {\n if (isJaypieError(error)) {\n // Cast to the specific type with _type property\n const jaypieError = error as JaypieErrorWithType;\n\n // If expected is also a JaypieError, check if the error matches\n if (expectedError && isJaypieError(expectedError)) {\n const expectedJaypieError = expectedError as JaypieErrorWithType;\n // If the error does not match, fail the test\n if (jaypieError._type !== expectedJaypieError._type) {\n return {\n pass: false,\n message: () =>\n `Expected function to throw \"${expectedJaypieError._type}\", but it threw \"${jaypieError._type}\"`,\n };\n }\n }\n return {\n pass: true,\n message: () =>\n `Expected function not to throw a JaypieError, but it threw ${error}`,\n };\n }\n\n return {\n pass: false,\n message: () =>\n `Expected function to throw a JaypieError, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Convenience Methods\n//\n\nconst toThrowBadGatewayError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadGatewayError);\nconst toThrowBadRequestError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadRequestError);\nconst toThrowConfigurationError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ConfigurationError);\nconst toThrowForbiddenError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ForbiddenError);\nconst toThrowGatewayTimeoutError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, GatewayTimeoutError);\nconst toThrowInternalError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, InternalError);\nconst toThrowNotFoundError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, NotFoundError);\nconst toThrowUnauthorizedError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnauthorizedError);\nconst toThrowUnavailableError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnavailableError);\n\n//\n//\n// Export\n//\n\nexport default toThrowJaypieError;\n\nexport {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n};\n","import * as jestExtendedMatchers from \"jest-extended\";\nimport { matchers as jestJsonSchemaMatchers } from \"jest-json-schema\";\nimport toBeCalledAboveTrace from \"./matchers/toBeCalledAboveTrace.matcher.js\";\nimport toBeCalledWithInitialParams from \"./matchers/toBeCalledWithInitialParams.matcher.js\";\nimport toBeClass from \"./matchers/toBeClass.matcher.js\";\nimport toBeJaypieError from \"./matchers/toBeJaypieError.matcher.js\";\nimport { toBeMockFunction } from \"./matchers/toBeMockFunction.matcher.js\";\nimport {\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n} from \"./matchers/toMatch.matcher.js\";\nimport toThrowError from \"./matchers/toThrowError.matcher.js\";\nimport toThrowJaypieError, {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n} from \"./matchers/toThrowJaypieError.matcher.js\";\n\n// Combine all matchers\nconst matchers = {\n // Custom Jaypie matchers\n toBeCalledAboveTrace,\n toBeCalledWithInitialParams,\n toBeClass,\n toBeJaypieError,\n toBeMockFunction,\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchSchema: jestJsonSchemaMatchers.toMatchSchema,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowJaypieError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n\n // Include all jest-extended matchers\n ...jestExtendedMatchers,\n};\n\nexport default matchers;\n","import { log } from \"@jaypie/core\";\nimport { vi } from \"vitest\";\nimport { LogMock } from \"./types/jaypie-testkit\";\n\nexport function mockLogFactory(): LogMock {\n // Create skeleton of mock objects\n const mock = {\n debug: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n info: vi.fn(),\n init: vi.fn(),\n lib: vi.fn(),\n tag: vi.fn(),\n trace: vi.fn(),\n untag: vi.fn(),\n var: vi.fn(),\n warn: vi.fn(),\n with: vi.fn(),\n } as LogMock;\n\n // Fill out nested mocks\n mock.debug.var = mock.var;\n mock.error.var = mock.var;\n mock.fatal.var = mock.var;\n mock.info.var = mock.var;\n mock.trace.var = mock.var;\n mock.warn.var = mock.var;\n\n // Have modules return correct objects\n mock.init.mockReturnValue(null);\n mock.lib.mockReturnValue(mock);\n mock.with.mockReturnValue(mock);\n\n // Pin mocks to the module\n mock.mock = {\n debug: mock.debug,\n error: mock.error,\n fatal: mock.fatal,\n info: mock.info,\n init: mock.init,\n lib: mock.lib,\n tag: mock.tag,\n trace: mock.trace,\n untag: mock.untag,\n var: mock.var,\n warn: mock.warn,\n with: mock.with,\n };\n\n return mock;\n}\n\nconst LOG_METHOD_NAMES = [\n \"debug\",\n \"error\",\n \"fatal\",\n \"info\",\n \"init\",\n \"lib\",\n \"tag\",\n \"trace\",\n \"untag\",\n \"var\",\n \"warn\",\n \"with\",\n] as const;\n\n// Use Record type for more flexible access pattern\nconst originalLogMethods = new WeakMap<typeof log, Record<string, unknown>>();\n\nexport function spyLog(logInstance: typeof log): void {\n if (!originalLogMethods.has(logInstance)) {\n const mockLog = mockLogFactory();\n const originalMethods: Record<string, unknown> = {};\n\n // Save only methods that actually exist on the log instance\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in logInstance) {\n originalMethods[method] =\n logInstance[method as keyof typeof logInstance];\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] = mockLog[method];\n }\n });\n\n originalLogMethods.set(logInstance, originalMethods);\n }\n}\n\nexport function restoreLog(logInstance: typeof log): void {\n const originalMethods = originalLogMethods.get(logInstance);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in originalMethods && method in logInstance) {\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] =\n originalMethods[method];\n }\n });\n originalLogMethods.delete(logInstance);\n }\n}\n","interface SQSEvent {\n Records: Array<{\n body: string;\n messageId?: string | number;\n [key: string]: unknown;\n }>;\n}\n\n/**\n * Creates a mock SQS event with the given records\n * @param records - Array of records or individual records to include in the event\n * @returns SQS event object with Records array\n */\nconst sqsTestRecords = (...records: Array<unknown>): SQSEvent => {\n // If first argument is an array, use that as records\n const recordsArray = Array.isArray(records[0]) ? records[0] : records;\n\n // Map records to SQS record format\n const formattedRecords = recordsArray.map((record) => {\n if (typeof record === \"object\" && record !== null) {\n return {\n ...record,\n body:\n typeof (record as { body?: unknown }).body === \"string\"\n ? (record as { body: string }).body\n : JSON.stringify((record as { body?: unknown }).body ?? record),\n };\n }\n return {\n body: String(record),\n };\n });\n\n return {\n Records: formattedRecords,\n };\n};\n\nexport default sqsTestRecords;\n"],"names":["isEqual","jsonSchemaMatchers","toBeCalledAboveTrace","jestJsonSchemaMatchers"],"mappings":";;;;;;AAAa,MAAA,GAAG,GAAG;AACjB,IAAA,KAAK,EAAE;AACL,QAAA,GAAG,EAAE,KAAK;AACV,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACb,KAAA;;AAGI,MAAM,iBAAiB,GAAG,sBAAsB;AAChD,MAAM,cAAc,GAAG,6BAA6B;AACpD,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,wBAAwB,GAAG,sBAAsB;AACvD,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,eAAe,GAC1B,2EAA2E;;ACpBhE,MAAA,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,UAAU,EAAE;AACV,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;AACV,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QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;YACjD,OAAO;AACL,gBAAA,GAAG,MAAM;AACT,gBAAA,IAAI,EACF,OAAQ,MAA6B,CAAC,IAAI,KAAK;sBAC1C,MAA2B,CAAC;sBAC7B,IAAI,CAAC,SAAS,CAAE,MAA6B,CAAC,IAAI,IAAI,MAAM,CAAC;aACpE;;QAEH,OAAO;AACL,YAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;SACrB;AACH,KAAC,CAAC;IAEF,OAAO;AACL,QAAA,OAAO,EAAE,gBAAgB;KAC1B;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/constants.ts","../src/jsonApiSchema.module.ts","../src/matchers/toBeCalledAboveTrace.matcher.ts","../src/matchers/toBeCalledWithInitialParams.matcher.ts","../src/matchers/toBeClass.matcher.ts","../src/matchers/toBeJaypieError.matcher.ts","../src/matchers/toBeMockFunction.matcher.ts","../src/matchers/toMatch.matcher.ts","../src/matchers/toThrowError.matcher.ts","../src/matchers/toThrowJaypieError.matcher.ts","../src/matchers.module.ts","../src/mockLog.module.ts","../src/sqsTestRecords.function.ts"],"sourcesContent":["export const LOG = {\n LEVEL: {\n ALL: \"all\",\n DEBUG: \"debug\",\n ERROR: \"error\",\n FATAL: \"fatal\",\n INFO: \"info\",\n SILENT: \"silent\",\n TRACE: \"trace\",\n WARN: \"warn\",\n },\n} as const;\n\nexport const RE_BASE64_PATTERN = /^[a-zA-Z0-9\\\\+\\\\/]+$/;\nexport const RE_JWT_PATTERN = /^([^.]+)\\.([^.]+)\\.([^.]+)$/;\nexport const RE_MONGO_ID_PATTERN = /^[a-f0-9]{24}$/i;\nexport const RE_SIGNED_COOKIE_PATTERN = /^s:([^.]+)\\.([^.]+)$/;\nexport const RE_UUID_4_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_5_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?5[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\n","import { JsonApiData, JsonApiError } from \"./types/jaypie-testkit\";\n\nexport const jsonApiErrorSchema = {\n type: \"object\",\n properties: {\n errors: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n status: { type: \"number\" },\n title: { type: \"string\" },\n detail: { type: \"string\" },\n },\n required: [\"status\", \"title\"],\n },\n minItems: 1,\n },\n },\n required: [\"errors\"],\n} as const;\n\nexport const jsonApiSchema = {\n type: \"object\",\n properties: {\n data: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n type: { type: \"string\" },\n attributes: { type: \"object\" },\n links: { type: \"object\" },\n meta: { type: \"object\" },\n relationships: { type: \"object\" },\n },\n required: [\"id\", \"type\"],\n },\n meta: { type: \"object\" },\n },\n required: [\"data\"],\n} as const;\n\n// Type guards\nexport const isJsonApiError = (obj: unknown): obj is JsonApiError => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"errors\" in obj && Array.isArray((obj as JsonApiError).errors);\n};\n\nexport const isJsonApiData = (obj: unknown): obj is JsonApiData => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"data\" in obj && typeof (obj as JsonApiData).data === \"object\";\n};\n","import { LogMock, MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst calledAboveTrace = (log: LogMock): MatcherResult => {\n try {\n if (\n log.debug.mock.calls.length > 0 ||\n log.info.mock.calls.length > 0 ||\n log.warn.mock.calls.length > 0 ||\n log.error.mock.calls.length > 0 ||\n log.fatal.mock.calls.length > 0\n ) {\n return {\n message: () => `expected log not to have been called above trace`,\n pass: true,\n };\n }\n } catch (error) {\n throw Error(`[calledAboveTrace] log is not a mock object`);\n }\n\n return {\n message: () => `expected log not to have been called above trace`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default calledAboveTrace;\n","import { isDeepStrictEqual as isEqual } from \"node:util\";\nimport { Mock } from \"vitest\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeCalledWithInitialParams = (\n received: Mock,\n ...passed: unknown[]\n): MatcherResult => {\n let pass: boolean | undefined;\n\n if (!received || typeof received !== \"function\" || !received.mock) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected a mock function`,\n pass: false,\n };\n }\n\n received.mock.calls.forEach((call: unknown[]) => {\n if (call.length >= passed.length) {\n let matching = true;\n for (let i = 0; i < passed.length && matching; i += 1) {\n if (!isEqual(passed[i], call[i])) matching = false;\n }\n pass = pass || matching;\n }\n });\n\n if (pass === undefined) pass = false;\n\n if (pass) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected call beginning with [${passed},...]`,\n pass: true,\n };\n } else {\n return {\n message: () =>\n `Expectation \\`not.toBeCalledWithInitialParams\\` did not expect call beginning with [${passed},...]`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeCalledWithInitialParams;\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeClass = (received: unknown): MatcherResult => {\n let pass = false;\n if (typeof received === \"function\") {\n try {\n new (received as any)();\n pass = true;\n } catch (error) {\n pass = false;\n }\n }\n if (pass) {\n return {\n message: () => `expected ${received} not to be a class`,\n pass: true,\n };\n }\n return {\n message: () => `expected ${received} to be a class`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default toBeClass;\n","import { matchers as jsonSchemaMatchers } from \"jest-json-schema\";\nimport { jsonApiErrorSchema } from \"../jsonApiSchema.module\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper Functions\n//\n\nfunction isErrorObjectJaypieError(error: Error): MatcherResult {\n if (\"isProjectError\" in error) {\n return {\n message: () => `expected \"${error}\" not to be a Jaypie error`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${error}\" to be a Jaypie error`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nconst toBeJaypieError = (received: unknown): MatcherResult => {\n // See if it is an instance of error:\n if (received instanceof Error) {\n return isErrorObjectJaypieError(received);\n }\n\n const result = jsonSchemaMatchers.toMatchSchema(received, jsonApiErrorSchema);\n if (result.pass) {\n return {\n message: () => `expected ${received} not to be a Jaypie error`,\n pass: true,\n };\n } else {\n return {\n message: () => `expected ${received} to be a Jaypie error`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeJaypieError;\n","import { vi } from \"vitest\";\nimport type { Assertion } from \"vitest\";\n\ndeclare module \"vitest\" {\n interface Assertion<T = any> {\n toBeMockFunction(): T;\n }\n}\n\nexport function toBeMockFunction(this: Assertion, received: unknown) {\n const { equals, utils } = this;\n const pass = typeof received === \"function\" && vi.isMockFunction(received);\n\n return {\n message: () =>\n `expected ${utils.printReceived(received)} ${\n pass ? \"not \" : \"\"\n }to be a mock function`,\n pass,\n };\n}\n","import {\n RE_BASE64_PATTERN,\n RE_JWT_PATTERN,\n RE_MONGO_ID_PATTERN,\n RE_SIGNED_COOKIE_PATTERN,\n RE_UUID_4_PATTERN,\n RE_UUID_5_PATTERN,\n RE_UUID_PATTERN,\n} from \"../constants.js\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper\n//\n\ninterface ForSubjectToMatchPatternOptions {\n patternName?: string;\n}\n\nfunction forSubjectToMatchPattern(\n subject: string,\n pattern: RegExp,\n { patternName = \"pattern\" }: ForSubjectToMatchPatternOptions = {},\n): MatcherResult {\n if (pattern.test(subject)) {\n return {\n message: () => `expected \"${subject}\" not to match ${patternName}`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${subject}\" to match ${patternName}`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nexport const toMatchBase64 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_BASE64_PATTERN, {\n patternName: \"Base64\",\n });\n\nexport const toMatchJwt = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_JWT_PATTERN, {\n patternName: \"JWT\",\n });\n\nexport const toMatchMongoId = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_MONGO_ID_PATTERN, {\n patternName: \"MongoDbId\",\n });\n\nexport const toMatchSignedCookie = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_SIGNED_COOKIE_PATTERN, {\n patternName: \"Signed-Cookie\",\n });\n\nexport const toMatchUuid4 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_4_PATTERN, {\n patternName: \"UUIDv4\",\n });\n\nexport const toMatchUuid5 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_5_PATTERN, {\n patternName: \"UUIDv5\",\n });\n\n/**\n * Determines if subject matches a UUID pattern.\n * Does _NOT_ check if the UUID is valid.\n */\nexport const toMatchUuid = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_PATTERN, {\n patternName: \"UUID\",\n });\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\n\nconst toThrowError = async (\n received: ReceivedFunction,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n return {\n pass: false,\n message: () =>\n \"Expected function to throw an error, but it did not throw.\",\n };\n } catch (error) {\n return {\n pass: true,\n message: () =>\n `Expected function not to throw an error, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toThrowError;\n","import {\n BadGatewayError,\n BadRequestError,\n ConfigurationError,\n ForbiddenError,\n GatewayTimeoutError,\n InternalError,\n isJaypieError,\n NotFoundError,\n ProjectError,\n UnauthorizedError,\n UnavailableError,\n} from \"@jaypie/core\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n// Define a more specific type for ProjectError with _type field\ntype JaypieErrorWithType = ProjectError & { _type: string };\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\ntype ErrorConstructor = new () => ProjectError;\n\nfunction isErrorConstructor(value: unknown): value is ErrorConstructor {\n return typeof value === \"function\" && \"prototype\" in value;\n}\n\nconst toThrowJaypieError = async (\n received: ReceivedFunction,\n expected?: ProjectError | (() => ProjectError) | ErrorConstructor,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n let expectedError: ProjectError | undefined = undefined;\n\n // Handle constructor, function, or instance\n if (typeof expected === \"function\") {\n if (isErrorConstructor(expected)) {\n // It's a constructor\n expectedError = new expected();\n } else {\n // It's a regular function\n expectedError = expected();\n }\n } else if (expected) {\n // It's an instance\n expectedError = expected;\n }\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n // If no error is thrown, fail the test\n return {\n pass: false,\n message: () =>\n \"Expected function to throw a JaypieError, but it did not throw.\",\n };\n } catch (error) {\n if (isJaypieError(error)) {\n // Cast to the specific type with _type property\n const jaypieError = error as JaypieErrorWithType;\n\n // If expected is also a JaypieError, check if the error matches\n if (expectedError && isJaypieError(expectedError)) {\n const expectedJaypieError = expectedError as JaypieErrorWithType;\n // If the error does not match, fail the test\n if (jaypieError._type !== expectedJaypieError._type) {\n return {\n pass: false,\n message: () =>\n `Expected function to throw \"${expectedJaypieError._type}\", but it threw \"${jaypieError._type}\"`,\n };\n }\n }\n return {\n pass: true,\n message: () =>\n `Expected function not to throw a JaypieError, but it threw ${error}`,\n };\n }\n\n return {\n pass: false,\n message: () =>\n `Expected function to throw a JaypieError, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Convenience Methods\n//\n\nconst toThrowBadGatewayError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadGatewayError);\nconst toThrowBadRequestError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadRequestError);\nconst toThrowConfigurationError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ConfigurationError);\nconst toThrowForbiddenError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ForbiddenError);\nconst toThrowGatewayTimeoutError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, GatewayTimeoutError);\nconst toThrowInternalError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, InternalError);\nconst toThrowNotFoundError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, NotFoundError);\nconst toThrowUnauthorizedError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnauthorizedError);\nconst toThrowUnavailableError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnavailableError);\n\n//\n//\n// Export\n//\n\nexport default toThrowJaypieError;\n\nexport {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n};\n","import * as jestExtendedMatchers from \"jest-extended\";\nimport { matchers as jestJsonSchemaMatchers } from \"jest-json-schema\";\nimport toBeCalledAboveTrace from \"./matchers/toBeCalledAboveTrace.matcher.js\";\nimport toBeCalledWithInitialParams from \"./matchers/toBeCalledWithInitialParams.matcher.js\";\nimport toBeClass from \"./matchers/toBeClass.matcher.js\";\nimport toBeJaypieError from \"./matchers/toBeJaypieError.matcher.js\";\nimport { toBeMockFunction } from \"./matchers/toBeMockFunction.matcher.js\";\nimport {\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n} from \"./matchers/toMatch.matcher.js\";\nimport toThrowError from \"./matchers/toThrowError.matcher.js\";\nimport toThrowJaypieError, {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n} from \"./matchers/toThrowJaypieError.matcher.js\";\n\n// Combine all matchers\nconst matchers = {\n // Custom Jaypie matchers\n toBeCalledAboveTrace,\n toBeCalledWithInitialParams,\n toBeClass,\n toBeJaypieError,\n toBeMockFunction,\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchSchema: jestJsonSchemaMatchers.toMatchSchema,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowJaypieError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n\n // Include all jest-extended matchers\n ...jestExtendedMatchers,\n};\n\nexport default matchers;\n","import { log } from \"@jaypie/core\";\nimport { vi } from \"vitest\";\nimport { LogMock } from \"./types/jaypie-testkit\";\n\nexport function mockLogFactory(): LogMock {\n // Create skeleton of mock objects\n const mock = {\n debug: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n info: vi.fn(),\n init: vi.fn(),\n lib: vi.fn(),\n tag: vi.fn(),\n trace: vi.fn(),\n untag: vi.fn(),\n var: vi.fn(),\n warn: vi.fn(),\n with: vi.fn(),\n } as LogMock;\n\n // Fill out nested mocks\n mock.debug.var = mock.var;\n mock.error.var = mock.var;\n mock.fatal.var = mock.var;\n mock.info.var = mock.var;\n mock.trace.var = mock.var;\n mock.warn.var = mock.var;\n\n // Have modules return correct objects\n mock.init.mockReturnValue(null);\n mock.lib.mockReturnValue(mock);\n mock.with.mockReturnValue(mock);\n\n // Pin mocks to the module\n mock.mock = {\n debug: mock.debug,\n error: mock.error,\n fatal: mock.fatal,\n info: mock.info,\n init: mock.init,\n lib: mock.lib,\n tag: mock.tag,\n trace: mock.trace,\n untag: mock.untag,\n var: mock.var,\n warn: mock.warn,\n with: mock.with,\n };\n\n return mock;\n}\n\nconst LOG_METHOD_NAMES = [\n \"debug\",\n \"error\",\n \"fatal\",\n \"info\",\n \"init\",\n \"lib\",\n \"tag\",\n \"trace\",\n \"untag\",\n \"var\",\n \"warn\",\n \"with\",\n] as const;\n\n// Use Record type for more flexible access pattern\nconst originalLogMethods = new WeakMap<typeof log, Record<string, unknown>>();\n\nexport function spyLog(logInstance: typeof log): void {\n if (!originalLogMethods.has(logInstance)) {\n const mockLog = mockLogFactory();\n const originalMethods: Record<string, unknown> = {};\n\n // Save only methods that actually exist on the log instance\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in logInstance) {\n originalMethods[method] =\n logInstance[method as keyof typeof logInstance];\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] = mockLog[method];\n }\n });\n\n originalLogMethods.set(logInstance, originalMethods);\n }\n}\n\nexport function restoreLog(logInstance: typeof log): void {\n const originalMethods = originalLogMethods.get(logInstance);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in originalMethods && method in logInstance) {\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] =\n originalMethods[method];\n }\n });\n originalLogMethods.delete(logInstance);\n }\n}\n","interface SQSEvent {\n Records: Array<{\n body: string;\n messageId?: string | number;\n [key: string]: unknown;\n }>;\n}\n\n/**\n * Creates a mock SQS event with the given records\n * @param records - Array of records or individual records to include in the event\n * @returns SQS event object with Records array\n */\nconst sqsTestRecords = (...records: Array<unknown>): SQSEvent => {\n // If first argument is an array, use that as records\n const recordsArray = Array.isArray(records[0]) ? records[0] : records;\n\n // Map records to SQS record format\n const formattedRecords = recordsArray.map((record) => {\n if (typeof record === \"object\" && record !== null) {\n return {\n ...record,\n body:\n typeof (record as { body?: unknown }).body === \"string\"\n ? (record as { body: string }).body\n : JSON.stringify((record as { body?: unknown }).body ?? record),\n };\n }\n return {\n body: String(record),\n };\n });\n\n return {\n Records: formattedRecords,\n };\n};\n\nexport default sqsTestRecords;\n"],"names":["isEqual","jsonSchemaMatchers","toBeCalledAboveTrace","jestJsonSchemaMatchers"],"mappings":";;;;;;AAAa,MAAA,GAAG,GAAG;AACjB,IAAA,KAAK,EAAE;AACL,QAAA,GAAG,EAAE,KAAK;AACV,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACb,KAAA;;AAGI,MAAM,iBAAiB,GAAG,sBAAsB;AAChD,MAAM,cAAc,GAAG,6BAA6B;AACpD,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,wBAAwB,GAAG,sBAAsB;AACvD,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,eAAe,GAC1B,2EAA2E;;ACpBhE,MAAA,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,UAAU,EAAE;AACV,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;AACV,oBAAA,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC1B,oBAAA,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AACzB,oBAAA,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC3B,iBAAA;AACD,gBAAA,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC9B,aAAA;AACD,YAAA,QAAQ,EAAE,CAAC;AACZ,SAAA;AACF,KAAA;IACD,QA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OAAO;AACL,QAAA,OAAO,EAAE,gBAAgB;KAC1B;AACH;;;;"}
@@ -74,6 +74,7 @@ export declare const required: {
74
74
  positive(value: unknown): value is number;
75
75
  string(value: unknown, defaultValue?: string): value is string;
76
76
  };
77
+ export declare const resolveValue: (...args: unknown[]) => unknown;
77
78
  export declare const safeParseFloat: (...args: unknown[]) => unknown;
78
79
  export declare const placeholders: (...args: unknown[]) => unknown;
79
80
  export declare const force: {
@@ -103,6 +103,7 @@ declare const required: {
103
103
  positive(value: unknown): value is number;
104
104
  string(value: unknown, defaultValue?: string): value is string;
105
105
  };
106
+ declare const resolveValue: (...args: unknown[]) => unknown;
106
107
  declare const safeParseFloat: (...args: unknown[]) => unknown;
107
108
  declare const placeholders: (...args: unknown[]) => unknown;
108
109
  declare const force: {
@@ -427,29 +428,9 @@ declare const Llm: vitest.Mock<(...args: any[]) => any> & {
427
428
  }>;
428
429
  send: (...args: unknown[]) => Promise<string>;
429
430
  };
430
- declare const toolkit: {
431
- random: (...args: unknown[]) => number;
432
- roll: (...args: unknown[]) => number;
433
- time: (...args: unknown[]) => string;
434
- weather: (...args: unknown[]) => Promise<{
435
- location: string;
436
- forecast: {
437
- date: string;
438
- temperature: number;
439
- condition: string;
440
- precipitation: number;
441
- }[];
442
- }>;
443
- };
444
- declare const tools: (((...args: unknown[]) => number) | ((...args: unknown[]) => string) | ((...args: unknown[]) => Promise<{
445
- location: string;
446
- forecast: {
447
- date: string;
448
- temperature: number;
449
- condition: string;
450
- precipitation: number;
451
- }[];
452
- }>))[];
431
+ declare const Toolkit: typeof original$2.Toolkit;
432
+ declare const toolkit: original$2.Toolkit;
433
+ declare const tools: Omit<original$2.LlmTool, "call">[];
453
434
 
454
435
  declare const connect: (...args: unknown[]) => boolean;
455
436
  declare const connectFromSecretEnv: (...args: unknown[]) => boolean;
@@ -466,5 +447,5 @@ declare const textractJsonToMarkdown: (...args: unknown[]) => string;
466
447
 
467
448
  declare const _default: Record<string, unknown>;
468
449
 
469
- export { BadGatewayError, BadRequestError, ConfigurationError, DATADOG, ERROR, EXPRESS, ForbiddenError, GatewayTimeoutError, GoneError, 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, _default 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 };
450
+ export { BadGatewayError, BadRequestError, ConfigurationError, DATADOG, ERROR, EXPRESS, ForbiddenError, GatewayTimeoutError, GoneError, HTTP, IllogicalError, InternalError, JAYPIE, LLM, Llm, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, PROJECT, ProjectError, ProjectMultiError, RejectedError, TeapotError, Toolkit, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, VALIDATE, badRequestRoute, cloneDeep, connect, connectFromSecretEnv, cors, _default 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, resolveValue, safeParseFloat, sendBatchMessages, sendMessage, sendTextractJob, sleep, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, uuid, validate };
470
451
  export type { ExpressHandlerFunction, ExpressHandlerOptions, LambdaOptions };
@@ -14,7 +14,6 @@ import { fileURLToPath } from 'url';
14
14
  import { TextractDocument } from 'amazon-textract-response-parser';
15
15
  import * as original$5 from '@jaypie/textract';
16
16
 
17
- /* eslint-disable @typescript-eslint/no-explicit-any */
18
17
  /**
19
18
  * Internal wrapper for vi.fn() that adds _jaypie: true to all mocks
20
19
  */
@@ -70,12 +69,10 @@ function createMockWrappedFunction(fn, fallbackOrOptions = "_MOCK_WRAPPED_RESULT
70
69
  if (throws) {
71
70
  throw error;
72
71
  }
73
- /* eslint-disable no-console */
74
72
  console.warn(`[@jaypie/testkit] Actual implementation failed. To suppress this warning, manually mock the response with mockReturnValue`);
75
73
  if (error instanceof Error) {
76
74
  console.warn(`[@jaypie/testkit] ${error.message}`);
77
75
  }
78
- /* eslint-enable no-console */
79
76
  // If fallback is a function, call it
80
77
  if (typeof fallback === "function") {
81
78
  try {
@@ -145,18 +142,79 @@ function createMockError(ErrorClass) {
145
142
  });
146
143
  return mockConstructor;
147
144
  }
145
+ /**
146
+ * Creates a mock LlmTool for testing purposes
147
+ * @param nameOrCallOrOptions - Name (string), call function, or full options object
148
+ * @param callOrOptions - Call function or options object (when first param is string)
149
+ * @returns Mock LlmTool object
150
+ */
151
+ function createMockTool(nameOrCallOrOptions, callOrOptions) {
152
+ // Default options
153
+ const defaults = {
154
+ name: "mockTool",
155
+ description: "Mock tool for testing",
156
+ parameters: {},
157
+ type: "function",
158
+ call: createMockResolvedFunction({ result: "MOCK_TOOL" }),
159
+ message: "MOCK_TOOL_MESSAGE",
160
+ };
161
+ // Handle different parameter combinations
162
+ if (typeof nameOrCallOrOptions === "string") {
163
+ // First parameter is name
164
+ const name = nameOrCallOrOptions;
165
+ if (typeof callOrOptions === "function") {
166
+ // Second parameter is call function
167
+ return {
168
+ ...defaults,
169
+ name,
170
+ call: callOrOptions,
171
+ };
172
+ }
173
+ else if (callOrOptions && typeof callOrOptions === "object") {
174
+ // Second parameter is options object
175
+ return {
176
+ ...defaults,
177
+ name,
178
+ ...callOrOptions,
179
+ };
180
+ }
181
+ else {
182
+ // Only name provided
183
+ return {
184
+ ...defaults,
185
+ name,
186
+ };
187
+ }
188
+ }
189
+ else if (typeof nameOrCallOrOptions === "function") {
190
+ // First parameter is call function
191
+ return {
192
+ ...defaults,
193
+ call: nameOrCallOrOptions,
194
+ };
195
+ }
196
+ else if (nameOrCallOrOptions && typeof nameOrCallOrOptions === "object") {
197
+ // First parameter is options object
198
+ return {
199
+ ...defaults,
200
+ ...nameOrCallOrOptions,
201
+ };
202
+ }
203
+ else {
204
+ // No parameters or invalid parameters
205
+ return defaults;
206
+ }
207
+ }
148
208
 
149
- /* eslint-disable @typescript-eslint/no-unused-vars */
150
- /* eslint-disable @typescript-eslint/no-explicit-any */
151
209
  // Constants for mock values
152
- const TAG$4 = "AWS";
210
+ const TAG$3 = "AWS";
153
211
  const getMessages = createMockWrappedFunction(original.getMessages, []);
154
212
  const getSecret = createMockResolvedFunction("mock-secret-value");
155
213
  const sendMessage = createMockResolvedFunction({
156
214
  MessageId: "mock-message-id",
157
215
  });
158
216
  // Add missing functions from original implementation
159
- const getEnvSecret = createMockFunction(async (key) => `_MOCK_ENV_SECRET_[${TAG$4}][${key}]`);
217
+ const getEnvSecret = createMockFunction(async (key) => `_MOCK_ENV_SECRET_[${TAG$3}][${key}]`);
160
218
  const getSingletonMessage = createMockWrappedFunction(original.getSingletonMessage, { value: "_MOCK_SINGLETON_MESSAGE_" });
161
219
  const getTextractJob = createMockFunction(async (job) => ({ value: `_MOCK_TEXTRACT_JOB_[${job}]` }));
162
220
  const sendBatchMessages = createMockResolvedFunction(true);
@@ -165,7 +223,7 @@ const sendTextractJob = createMockFunction(async ({ bucket, key, featureTypes =
165
223
  if (!bucket || !key) {
166
224
  throw new Error("Bucket and key are required");
167
225
  }
168
- return [`_MOCK_TEXTRACT_JOB_ID_[${TAG$4}]_${bucket}_${key}`];
226
+ return [`_MOCK_TEXTRACT_JOB_ID_[${TAG$3}]_${bucket}_${key}`];
169
227
  });
170
228
 
171
229
  var aws = /*#__PURE__*/Object.freeze({
@@ -258,10 +316,8 @@ function spyLog(logInstance) {
258
316
  }
259
317
 
260
318
  /* 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
319
  // Constants for mock values
264
- const TAG$3 = "CORE";
320
+ const TAG$2 = "CORE";
265
321
  const BadGatewayError = createMockError(original$1.BadGatewayError);
266
322
  const BadRequestError = createMockError(original$1.BadRequestError);
267
323
  const ConfigurationError = createMockError(original$1.ConfigurationError);
@@ -295,7 +351,7 @@ const cloneDeep = createMockWrappedFunction(original$1.cloneDeep, {
295
351
  throws: true,
296
352
  });
297
353
  const envBoolean = createMockReturnedFunction(true);
298
- const envsKey = createMockWrappedFunction(original$1.envsKey, `_MOCK_ENVS_KEY_[${TAG$3}]`);
354
+ const envsKey = createMockWrappedFunction(original$1.envsKey, `_MOCK_ENVS_KEY_[${TAG$2}]`);
299
355
  const errorFromStatusCode = createMockFunction((statusCode, message = `Mock error for status code ${statusCode}`) => {
300
356
  try {
301
357
  // Try to mimic original implementation
@@ -329,13 +385,13 @@ const errorFromStatusCode = createMockFunction((statusCode, message = `Mock erro
329
385
  }
330
386
  }
331
387
  catch (error) {
332
- return new Error(`_MOCK_ERROR_FROM_STATUS_CODE_[${TAG$3}][${statusCode}]`);
388
+ return new Error(`_MOCK_ERROR_FROM_STATUS_CODE_[${TAG$2}][${statusCode}]`);
333
389
  }
334
390
  });
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}]`);
391
+ const formatError = createMockWrappedFunction(original$1.formatError, `_MOCK_FORMAT_ERROR_[${TAG$2}]`);
392
+ const getHeaderFrom = createMockWrappedFunction(original$1.getHeaderFrom, `_MOCK_GET_HEADER_FROM_[${TAG$2}]`);
393
+ const getObjectKeyCaseInsensitive = createMockWrappedFunction(original$1.getObjectKeyCaseInsensitive, `_MOCK_GET_OBJECT_KEY_CASE_INSENSITIVE_[${TAG$2}]`);
394
+ const isClass = createMockWrappedFunction(original$1.isClass, `_MOCK_IS_CLASS_[${TAG$2}]`);
339
395
  const isJaypieError = createMockWrappedFunction(original$1.isJaypieError, false);
340
396
  // Optional/Required validation functions
341
397
  const optional = createMockWrappedObject(original$1.optional, {
@@ -346,8 +402,9 @@ const required = createMockWrappedObject(original$1.required, {
346
402
  fallback: true,
347
403
  throws: true,
348
404
  });
349
- const safeParseFloat = createMockWrappedFunction(original$1.safeParseFloat, `_MOCK_SAFE_PARSE_FLOAT_[${TAG$3}]`);
350
- const placeholders = createMockWrappedFunction(original$1.placeholders, `_MOCK_PLACEHOLDERS_[${TAG$3}]`);
405
+ const resolveValue = createMockWrappedFunction(original$1.resolveValue, `_MOCK_RESOLVE_VALUE_[${TAG$2}]`);
406
+ const safeParseFloat = createMockWrappedFunction(original$1.safeParseFloat, `_MOCK_SAFE_PARSE_FLOAT_[${TAG$2}]`);
407
+ const placeholders = createMockWrappedFunction(original$1.placeholders, `_MOCK_PLACEHOLDERS_[${TAG$2}]`);
351
408
  // Add force utilities to help with jaypieHandler implementation
352
409
  const force = createMockWrappedObject(original$1.force);
353
410
  const jaypieHandler = createMockFunction((handler, options = {}) => {
@@ -453,6 +510,7 @@ var core = /*#__PURE__*/Object.freeze({
453
510
  optional: optional,
454
511
  placeholders: placeholders,
455
512
  required: required,
513
+ resolveValue: resolveValue,
456
514
  safeParseFloat: safeParseFloat,
457
515
  sleep: sleep,
458
516
  uuid: uuid,
@@ -471,27 +529,25 @@ var datadog = /*#__PURE__*/Object.freeze({
471
529
  });
472
530
 
473
531
  /* 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
532
  // Constants for mock values
477
- const TAG$2 = "EXPRESS";
533
+ const TAG$1 = "EXPRESS";
478
534
  const HTTP = {
479
535
  CODE: { OK: 200, CREATED: 201, NO_CONTENT: 204, INTERNAL_ERROR: 500 },
480
536
  };
481
537
  const EXPRESS = original$3.EXPRESS;
482
538
  // Add Express route functions
483
- const badRequestRoute = createMockWrappedFunction(original$3.badRequestRoute, { error: `_MOCK_BAD_REQUEST_ROUTE_[${TAG$2}]` });
539
+ const badRequestRoute = createMockWrappedFunction(original$3.badRequestRoute, { error: `_MOCK_BAD_REQUEST_ROUTE_[${TAG$1}]` });
484
540
  const echoRoute = createMockWrappedFunction(original$3.echoRoute, (req) => req);
485
- const forbiddenRoute = createMockWrappedFunction(original$3.forbiddenRoute, { error: `_MOCK_FORBIDDEN_ROUTE_[${TAG$2}]` });
541
+ const forbiddenRoute = createMockWrappedFunction(original$3.forbiddenRoute, { error: `_MOCK_FORBIDDEN_ROUTE_[${TAG$1}]` });
486
542
  const goneRoute = createMockWrappedFunction(original$3.goneRoute, {
487
- error: `_MOCK_GONE_ROUTE_[${TAG$2}]`,
543
+ error: `_MOCK_GONE_ROUTE_[${TAG$1}]`,
488
544
  });
489
- const methodNotAllowedRoute = createMockWrappedFunction(original$3.methodNotAllowedRoute, { error: `_MOCK_METHOD_NOT_ALLOWED_ROUTE_[${TAG$2}]` });
545
+ const methodNotAllowedRoute = createMockWrappedFunction(original$3.methodNotAllowedRoute, { error: `_MOCK_METHOD_NOT_ALLOWED_ROUTE_[${TAG$1}]` });
490
546
  const noContentRoute = createMockWrappedFunction(original$3.noContentRoute, { status: 204 });
491
547
  const notFoundRoute = createMockWrappedFunction(original$3.notFoundRoute, {
492
- error: `_MOCK_NOT_FOUND_ROUTE_[${TAG$2}]`,
548
+ error: `_MOCK_NOT_FOUND_ROUTE_[${TAG$1}]`,
493
549
  });
494
- const notImplementedRoute = createMockWrappedFunction(original$3.notImplementedRoute, { error: `_MOCK_NOT_IMPLEMENTED_ROUTE_[${TAG$2}]` });
550
+ const notImplementedRoute = createMockWrappedFunction(original$3.notImplementedRoute, { error: `_MOCK_NOT_IMPLEMENTED_ROUTE_[${TAG$1}]` });
495
551
  const expressHttpCodeHandler = createMockWrappedFunction(original$3.expressHttpCodeHandler, (...args) => {
496
552
  const [req, res, next] = args;
497
553
  return res.status(200).send();
@@ -661,9 +717,6 @@ var lambda = /*#__PURE__*/Object.freeze({
661
717
  lambdaHandler: lambdaHandler
662
718
  });
663
719
 
664
- /* eslint-disable @typescript-eslint/no-unused-vars */
665
- // Constants for mock values
666
- const TAG$1 = "LLM";
667
720
  const LLM = original$4.LLM;
668
721
  const mockOperate = createMockResolvedFunction({
669
722
  history: [
@@ -717,33 +770,25 @@ const Llm = Object.assign(vi.fn().mockImplementation((providerName = "_MOCK_LLM_
717
770
  send: mockSend,
718
771
  });
719
772
  // 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
- })),
773
+ const random = createMockTool("random", createMockReturnedFunction(0.5));
774
+ const roll = createMockTool("roll", createMockReturnedFunction(6));
775
+ const time = createMockTool("time", createMockReturnedFunction(`_MOCK_TIME`));
776
+ const weather = createMockTool("weather", createMockResolvedFunction({
777
+ location: `_MOCK_WEATHER_LOCATION`,
778
+ forecast: [{ conditions: "good" }],
779
+ }));
780
+ const Toolkit = createMockWrappedObject(original$4.Toolkit, {
781
+ isClass: true,
733
782
  });
734
783
  // Tool collections
735
- const toolkit = {
736
- random,
737
- roll,
738
- time,
739
- weather,
740
- };
741
- const tools = Object.values(toolkit);
784
+ const toolkit = new original$4.Toolkit([random, roll, time, weather]);
785
+ const tools = toolkit.tools;
742
786
 
743
787
  var llm = /*#__PURE__*/Object.freeze({
744
788
  __proto__: null,
745
789
  LLM: LLM,
746
790
  Llm: Llm,
791
+ Toolkit: Toolkit,
747
792
  toolkit: toolkit,
748
793
  tools: tools
749
794
  });
@@ -761,7 +806,6 @@ var mongoose = /*#__PURE__*/Object.freeze({
761
806
  mongoose: mongoose$1
762
807
  });
763
808
 
764
- /* eslint-disable @typescript-eslint/no-unused-vars */
765
809
  // Constants for mock values
766
810
  const TAG = "TEXTRACT";
767
811
  const __filename = fileURLToPath(import.meta.url);
@@ -821,5 +865,5 @@ var index = {
821
865
  ...textract$1,
822
866
  };
823
867
 
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 };
868
+ 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, Toolkit, 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, resolveValue, safeParseFloat, sendBatchMessages, sendMessage, sendTextractJob, sleep, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, uuid, validate };
825
869
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/mock/utils.ts","../../../src/mock/aws.ts","../../../src/mockLog.module.ts","../../../src/mock/core.ts","../../../src/mock/datadog.ts","../../../src/mock/express.ts","../../../src/mock/lambda.ts","../../../src/mock/llm.ts","../../../src/mock/mongoose.ts","../../../src/mock/textract.ts","../../../src/mock/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { vi } from \"vitest\";\n\n/**\n * Internal wrapper for vi.fn() that adds _jaypie: true to all mocks\n */\nfunction _createJaypieMock<T extends (...args: any[]) => any>(\n implementation?: T,\n): ReturnType<typeof vi.fn> {\n const mock = vi.fn(implementation);\n Object.defineProperty(mock, \"_jaypie\", { value: true });\n return mock;\n}\n\n/**\n * Creates function mocks with proper typing\n * Internal utility to create properly typed mocks\n */\nfunction createMockFunction<T extends (...args: any[]) => any>(\n implementation?: (...args: Parameters<T>) => ReturnType<T>,\n): T & { mock: any } {\n // Use a more specific type conversion to avoid TypeScript error\n return _createJaypieMock(implementation) as unknown as T & { mock: any };\n}\n\n/**\n * Creates a mock function that resolves to a value when awaited\n * Internal utility to create async mock functions\n */\nfunction createMockResolvedFunction<T>(\n value: T,\n): (...args: unknown[]) => Promise<T> {\n return _createJaypieMock().mockResolvedValue(value);\n}\n\n/**\n * Creates a mock function that returns a value\n * Internal utility to create mock functions that return a value\n */\nfunction createMockReturnedFunction<T>(value: T): (...args: unknown[]) => T {\n return _createJaypieMock().mockReturnValue(value);\n}\n\n/**\n * Creates a mock function that wraps another function\n * Internal utility to create mock functions that wrap another function\n */\nfunction createMockWrappedFunction<T>(\n fn: (...args: unknown[]) => unknown,\n fallbackOrOptions:\n | any\n | {\n fallback?: any;\n throws?: boolean;\n class?: boolean;\n } = \"_MOCK_WRAPPED_RESULT\",\n): (...args: unknown[]) => T {\n // Determine if we have a direct fallback or options object\n const options =\n typeof fallbackOrOptions === \"object\" &&\n fallbackOrOptions !== null &&\n (\"fallback\" in fallbackOrOptions ||\n \"throws\" in fallbackOrOptions ||\n \"class\" in fallbackOrOptions)\n ? fallbackOrOptions\n : { fallback: fallbackOrOptions };\n\n // Extract values with defaults\n const fallback = options.fallback ?? \"_MOCK_WRAPPED_RESULT\";\n const throws = options.throws ?? false;\n const isClass = options.class ?? false;\n\n return _createJaypieMock().mockImplementation((...args: unknown[]) => {\n try {\n return isClass ? new (fn as any)(...args) : fn(...args);\n } catch (error) {\n if (throws) {\n throw error;\n }\n\n /* eslint-disable no-console */\n console.warn(\n `[@jaypie/testkit] Actual implementation failed. To suppress this warning, manually mock the response with mockReturnValue`,\n );\n if (error instanceof Error) {\n console.warn(`[@jaypie/testkit] ${error.message}`);\n }\n /* eslint-enable no-console */\n\n // If fallback is a function, call it\n if (typeof fallback === \"function\") {\n try {\n return fallback(...args);\n } catch (fallbackError) {\n console.warn(\n `[@jaypie/testkit] Fallback function failed: ${fallbackError instanceof Error ? fallbackError.message : fallbackError}`,\n );\n return \"_MOCK_WRAPPED_RESULT\";\n }\n }\n\n return fallback;\n }\n });\n}\n\nfunction createMockWrappedObject<T extends Record<string, any>>(\n object: T,\n fallbackOrOptions:\n | any\n | {\n fallback?: any;\n throws?: boolean;\n class?: boolean;\n } = \"_MOCK_WRAPPED_RESULT\",\n): T {\n let returnMock: Record<string, any> = {};\n\n // Extract values with defaults for the top-level call\n const options =\n typeof fallbackOrOptions === \"object\" &&\n fallbackOrOptions !== null &&\n (\"fallback\" in fallbackOrOptions ||\n \"throws\" in fallbackOrOptions ||\n \"class\" in fallbackOrOptions)\n ? fallbackOrOptions\n : { fallback: fallbackOrOptions };\n\n const fallback = options.fallback ?? \"_MOCK_WRAPPED_RESULT\";\n const throws = options.throws ?? false;\n const isClass = options.class ?? false;\n\n // Create options for recursive calls\n // Do not pass down class=true to nested objects\n const recursiveOptions = {\n fallback,\n throws,\n class: false, // Always pass class=false to nested objects\n };\n\n if (typeof object === \"function\") {\n returnMock = createMockWrappedFunction(object, {\n fallback,\n throws,\n class: isClass,\n });\n }\n for (const key of Object.keys(object)) {\n const value = object[key];\n if (typeof value === \"function\") {\n returnMock[key] = createMockWrappedFunction(value, {\n fallback,\n throws,\n class: isClass,\n });\n } else if (typeof value === \"object\" && value !== null) {\n returnMock[key] = createMockWrappedObject(value, recursiveOptions);\n } else {\n returnMock[key] = value;\n }\n }\n return returnMock as T;\n}\n\n/**\n * Utility to create a mock error constructor from an error class\n */\nfunction createMockError<T extends new (...args: any[]) => Error>(\n ErrorClass: T,\n): T {\n // Create a mock constructor that returns a new instance of ErrorClass\n const mockConstructor = _createJaypieMock(function (\n this: any,\n ...args: any[]\n ) {\n return new ErrorClass(...args);\n });\n return mockConstructor as unknown as T;\n}\n\n// Mock core errors - All error classes extend JaypieError\nclass MockValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ValidationError\";\n }\n}\n\nclass MockNotFoundError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NotFoundError\";\n }\n}\n\n// Export functions for internal use\nexport {\n createMockFunction,\n createMockResolvedFunction,\n createMockReturnedFunction,\n createMockWrappedFunction,\n createMockWrappedObject,\n MockValidationError,\n MockNotFoundError,\n createMockError,\n};\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as original from \"@jaypie/aws\";\nimport {\n createMockFunction,\n createMockResolvedFunction,\n createMockWrappedFunction,\n} from \"./utils\";\n\n// Constants for mock values\nconst TAG = \"AWS\";\n\nexport const getMessages = createMockWrappedFunction(original.getMessages, []);\n\nexport const getSecret = createMockResolvedFunction(\"mock-secret-value\");\n\nexport const sendMessage = createMockResolvedFunction({\n MessageId: \"mock-message-id\",\n});\n\n// Add missing functions from original implementation\nexport const getEnvSecret = createMockFunction<\n (key: string) => Promise<string>\n>(async (key) => `_MOCK_ENV_SECRET_[${TAG}][${key}]`);\n\nexport const getSingletonMessage = createMockWrappedFunction(\n original.getSingletonMessage,\n { value: \"_MOCK_SINGLETON_MESSAGE_\" },\n);\n\nexport const getTextractJob = createMockFunction<\n (jobId: string) => Promise<any>\n>(async (job) => ({ value: `_MOCK_TEXTRACT_JOB_[${job}]` }));\n\nexport const sendBatchMessages = createMockResolvedFunction(true);\n\nexport const sendTextractJob = createMockFunction<\n ({\n bucket,\n key,\n featureTypes,\n }: {\n bucket: string;\n key: string;\n featureTypes?: string[];\n snsRoleArn?: string;\n snsTopicArn?: string;\n }) => Promise<any[]>\n>(async ({ bucket, key, featureTypes = [] }) => {\n // Basic validation to mimic original behavior\n if (!bucket || !key) {\n throw new Error(\"Bucket and key are required\");\n }\n return [`_MOCK_TEXTRACT_JOB_ID_[${TAG}]_${bucket}_${key}`];\n});\n","import { log } from \"@jaypie/core\";\nimport { vi } from \"vitest\";\nimport { LogMock } from \"./types/jaypie-testkit\";\n\nexport function mockLogFactory(): LogMock {\n // Create skeleton of mock objects\n const mock = {\n debug: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n info: vi.fn(),\n init: vi.fn(),\n lib: vi.fn(),\n tag: vi.fn(),\n trace: vi.fn(),\n untag: vi.fn(),\n var: vi.fn(),\n warn: vi.fn(),\n with: vi.fn(),\n } as LogMock;\n\n // Fill out nested mocks\n mock.debug.var = mock.var;\n mock.error.var = mock.var;\n mock.fatal.var = mock.var;\n mock.info.var = mock.var;\n mock.trace.var = mock.var;\n mock.warn.var = mock.var;\n\n // Have modules return correct objects\n mock.init.mockReturnValue(null);\n mock.lib.mockReturnValue(mock);\n mock.with.mockReturnValue(mock);\n\n // Pin mocks to the module\n mock.mock = {\n debug: mock.debug,\n error: mock.error,\n fatal: mock.fatal,\n info: mock.info,\n init: mock.init,\n lib: mock.lib,\n tag: mock.tag,\n trace: mock.trace,\n untag: mock.untag,\n var: mock.var,\n warn: mock.warn,\n with: mock.with,\n };\n\n return mock;\n}\n\nconst LOG_METHOD_NAMES = [\n \"debug\",\n \"error\",\n \"fatal\",\n \"info\",\n \"init\",\n \"lib\",\n \"tag\",\n \"trace\",\n \"untag\",\n \"var\",\n \"warn\",\n \"with\",\n] as const;\n\n// Use Record type for more flexible access pattern\nconst originalLogMethods = new WeakMap<typeof log, Record<string, unknown>>();\n\nexport function spyLog(logInstance: typeof log): void {\n if (!originalLogMethods.has(logInstance)) {\n const mockLog = mockLogFactory();\n const originalMethods: Record<string, unknown> = {};\n\n // Save only methods that actually exist on the log instance\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in logInstance) {\n originalMethods[method] =\n logInstance[method as keyof typeof logInstance];\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] = mockLog[method];\n }\n });\n\n originalLogMethods.set(logInstance, originalMethods);\n }\n}\n\nexport function restoreLog(logInstance: typeof log): void {\n const originalMethods = originalLogMethods.get(logInstance);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in originalMethods && method in logInstance) {\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] =\n originalMethods[method];\n }\n });\n originalLogMethods.delete(logInstance);\n }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-function-type */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n createMockError,\n createMockFunction,\n createMockResolvedFunction,\n createMockReturnedFunction,\n createMockWrappedFunction,\n createMockWrappedObject,\n} from \"./utils\";\nimport { beforeAll, vi } from \"vitest\";\nimport { spyLog } from \"../mockLog.module.js\";\nimport { log } from \"@jaypie/core\";\nimport * as original from \"@jaypie/core\";\n\n// Constants for mock values\nconst TAG = \"CORE\";\n\nexport const BadGatewayError = createMockError(original.BadGatewayError);\nexport const BadRequestError = createMockError(original.BadRequestError);\nexport const ConfigurationError = createMockError(original.ConfigurationError);\nexport const ForbiddenError = createMockError(original.ForbiddenError);\nexport const GatewayTimeoutError = createMockError(\n original.GatewayTimeoutError,\n);\nexport const GoneError = createMockError(original.GoneError);\nexport const IllogicalError = createMockError(original.IllogicalError);\nexport const InternalError = createMockError(original.InternalError);\nexport const MethodNotAllowedError = createMockError(\n original.MethodNotAllowedError,\n);\nexport const MultiError = createMockError(original.MultiError);\nexport const NotFoundError = createMockError(original.NotFoundError);\nexport const NotImplementedError = createMockError(\n original.NotImplementedError,\n);\nexport const ProjectError = createMockError(original.ProjectError);\nexport const ProjectMultiError = createMockError(original.ProjectMultiError);\nexport const RejectedError = createMockError(original.RejectedError);\nexport const TeapotError = createMockError(original.TeapotError);\nexport const UnauthorizedError = createMockError(original.UnauthorizedError);\nexport const UnavailableError = createMockError(original.UnavailableError);\nexport const UnhandledError = createMockError(original.UnhandledError);\nexport const UnreachableCodeError = createMockError(\n original.UnreachableCodeError,\n);\n\n// Mock core functions\nexport const validate = createMockWrappedObject(original.validate, {\n fallback: false,\n throws: true,\n});\n\nbeforeAll(async () => {\n spyLog(log);\n});\nexport { log };\n\n// Add missing core functions\nexport const cloneDeep = createMockWrappedFunction(original.cloneDeep, {\n throws: true,\n});\n\nexport const envBoolean = createMockReturnedFunction(true);\n\nexport const envsKey = createMockWrappedFunction(\n original.envsKey,\n `_MOCK_ENVS_KEY_[${TAG}]`,\n);\n\nexport const errorFromStatusCode = createMockFunction<\n (statusCode: number, message?: string) => Error\n>((statusCode, message = `Mock error for status code ${statusCode}`) => {\n try {\n // Try to mimic original implementation\n switch (statusCode) {\n case 400:\n return new BadRequestError(message);\n case 401:\n return new UnauthorizedError(message);\n case 403:\n return new ForbiddenError(message);\n case 404:\n return new NotFoundError(message);\n case 405:\n return new MethodNotAllowedError(message);\n case 410:\n return new GoneError(message);\n case 418:\n return new TeapotError(message);\n case 500:\n return new InternalError(message);\n case 501:\n return new NotImplementedError(message);\n case 502:\n return new BadGatewayError(message);\n case 503:\n return new UnavailableError(message);\n case 504:\n return new GatewayTimeoutError(message);\n default:\n return new Error(message);\n }\n } catch (error) {\n return new Error(`_MOCK_ERROR_FROM_STATUS_CODE_[${TAG}][${statusCode}]`);\n }\n});\n\nexport const formatError = createMockWrappedFunction(\n original.formatError,\n `_MOCK_FORMAT_ERROR_[${TAG}]`,\n);\n\nexport const getHeaderFrom = createMockWrappedFunction(\n original.getHeaderFrom,\n `_MOCK_GET_HEADER_FROM_[${TAG}]`,\n);\n\nexport const getObjectKeyCaseInsensitive = createMockWrappedFunction(\n original.getObjectKeyCaseInsensitive,\n `_MOCK_GET_OBJECT_KEY_CASE_INSENSITIVE_[${TAG}]`,\n);\n\nexport const isClass = createMockWrappedFunction(\n original.isClass,\n `_MOCK_IS_CLASS_[${TAG}]`,\n);\n\nexport const isJaypieError = createMockWrappedFunction(\n original.isJaypieError,\n false,\n);\n\n// Optional/Required validation functions\nexport const optional = createMockWrappedObject(original.optional, {\n fallback: true,\n throws: true,\n});\n\nexport const required = createMockWrappedObject(original.required, {\n fallback: true,\n throws: true,\n});\n\nexport const safeParseFloat = createMockWrappedFunction(\n original.safeParseFloat,\n `_MOCK_SAFE_PARSE_FLOAT_[${TAG}]`,\n);\n\nexport const placeholders = createMockWrappedFunction(\n original.placeholders,\n `_MOCK_PLACEHOLDERS_[${TAG}]`,\n);\n\n// Add force utilities to help with jaypieHandler implementation\nexport const force = createMockWrappedObject(original.force);\n\nexport const jaypieHandler = createMockFunction<\n (\n handler: Function,\n options?: {\n setup?: Function | Function[];\n teardown?: Function | Function[];\n unavailable?: boolean;\n validate?: Function | Function[];\n },\n ) => Function\n>((handler, options = {}) => {\n return async (...args: any[]) => {\n let result;\n let thrownError;\n\n // Destructure options with defaults\n const {\n setup = [],\n teardown = [],\n unavailable = original.force.boolean(process.env.PROJECT_UNAVAILABLE),\n validate = [],\n } = options;\n\n // Check if service is unavailable\n if (unavailable) throw new UnavailableError(\"Service unavailable\");\n\n // Run validation functions\n const validateFunctions = original.force.array(validate);\n for (const validator of validateFunctions) {\n if (typeof validator === \"function\") {\n const valid = await validator(...args);\n if (valid === false) {\n throw new BadRequestError(\"Validation failed\");\n }\n }\n }\n\n try {\n // Run setup functions\n const setupFunctions = original.force.array(setup);\n for (const setupFunction of setupFunctions) {\n if (typeof setupFunction === \"function\") {\n await setupFunction(...args);\n }\n }\n\n // Execute the handler\n result = await handler(...args);\n } catch (error) {\n thrownError = error;\n }\n\n // Run teardown functions (always run even if there was an error)\n const teardownFunctions = original.force.array(teardown);\n for (const teardownFunction of teardownFunctions) {\n if (typeof teardownFunction === \"function\") {\n try {\n await teardownFunction(...args);\n } catch (error) {\n // Swallow teardown errors, but log them\n console.error(error);\n }\n }\n }\n\n // If there was an error in the handler, throw it after teardown\n if (thrownError) {\n throw thrownError;\n }\n\n return result;\n };\n});\n\nexport const sleep = createMockResolvedFunction(true);\n\nexport const uuid = createMockWrappedFunction(\n original.uuid,\n `00000000-0000-0000-0000-000000000000`,\n);\n\nexport const ERROR = original.ERROR;\nexport const HTTP = original.HTTP;\nexport const JAYPIE = original.JAYPIE;\nexport const PROJECT = original.PROJECT;\nexport const VALIDATE = original.VALIDATE;\n","import { createMockResolvedFunction } from \"./utils\";\n\nimport * as original from \"@jaypie/datadog\";\n\nexport const DATADOG = original.DATADOG;\nexport const submitMetric = createMockResolvedFunction(true);\n\nexport const submitMetricSet = createMockResolvedFunction(true);\n","/* eslint-disable @typescript-eslint/no-unsafe-function-type */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n createMockFunction,\n createMockReturnedFunction,\n createMockResolvedFunction,\n createMockWrappedFunction,\n} from \"./utils\";\nimport { BadRequestError, UnhandledError } from \"@jaypie/core\";\nimport { force, jaypieHandler } from \"./core\";\nimport * as original from \"@jaypie/express\";\n\n// Constants for mock values\nconst TAG = \"EXPRESS\";\nconst HTTP = {\n CODE: { OK: 200, CREATED: 201, NO_CONTENT: 204, INTERNAL_ERROR: 500 },\n};\n\nexport const EXPRESS = original.EXPRESS;\n\n// Add Express route functions\nexport const badRequestRoute = createMockWrappedFunction(\n original.badRequestRoute,\n { error: `_MOCK_BAD_REQUEST_ROUTE_[${TAG}]` },\n);\n\nexport const echoRoute = createMockWrappedFunction(\n original.echoRoute,\n (req) => req,\n);\n\nexport const forbiddenRoute = createMockWrappedFunction(\n original.forbiddenRoute,\n { error: `_MOCK_FORBIDDEN_ROUTE_[${TAG}]` },\n);\n\nexport const goneRoute = createMockWrappedFunction(original.goneRoute, {\n error: `_MOCK_GONE_ROUTE_[${TAG}]`,\n});\n\nexport const methodNotAllowedRoute = createMockWrappedFunction(\n original.methodNotAllowedRoute,\n { error: `_MOCK_METHOD_NOT_ALLOWED_ROUTE_[${TAG}]` },\n);\n\nexport const noContentRoute = createMockWrappedFunction(\n original.noContentRoute,\n { status: 204 },\n);\n\nexport const notFoundRoute = createMockWrappedFunction(original.notFoundRoute, {\n error: `_MOCK_NOT_FOUND_ROUTE_[${TAG}]`,\n});\n\nexport const notImplementedRoute = createMockWrappedFunction(\n original.notImplementedRoute,\n { error: `_MOCK_NOT_IMPLEMENTED_ROUTE_[${TAG}]` },\n);\n\nexport const expressHttpCodeHandler = createMockWrappedFunction(\n original.expressHttpCodeHandler,\n (...args) => {\n const [req, res, next] = args;\n return res.status(200).send();\n },\n);\n\nexport const cors = createMockWrappedFunction(original.cors);\n\n// Type definitions needed for the expressHandler\ninterface WithJsonFunction {\n json: () => any;\n}\n\nexport interface ExpressHandlerFunction {\n (req: any, res: any, ...extra: any[]): Promise<any> | any;\n}\n\nexport interface ExpressHandlerOptions {\n locals?: Record<string, any>;\n setup?: any[] | Function;\n teardown?: any[] | Function;\n unavailable?: boolean;\n validate?: any[] | Function;\n}\n\ntype ExpressHandlerParameter = ExpressHandlerFunction | ExpressHandlerOptions;\n\nexport const expressHandler = createMockFunction<\n (\n handlerOrProps: ExpressHandlerParameter,\n propsOrHandler?: ExpressHandlerParameter,\n ) => (req: any, res: any, ...extra: any[]) => Promise<any>\n>((handlerOrProps, propsOrHandler) => {\n let handler: ExpressHandlerFunction;\n let props: ExpressHandlerOptions;\n\n if (\n typeof handlerOrProps === \"object\" &&\n typeof propsOrHandler === \"function\"\n ) {\n handler = propsOrHandler;\n props = handlerOrProps;\n } else if (typeof handlerOrProps === \"function\") {\n handler = handlerOrProps;\n props = (propsOrHandler || {}) as ExpressHandlerOptions;\n } else {\n throw new BadRequestError(\"handler must be a function\");\n }\n\n // Add locals setup if needed\n if (\n props.locals &&\n typeof props.locals === \"object\" &&\n !Array.isArray(props.locals)\n ) {\n const keys = Object.keys(props.locals);\n if (!props.setup) props.setup = [];\n props.setup = force.array(props.setup);\n // @ts-expect-error TODO: cannot resolve; fix when JaypieHandler moves to TypeScript\n props.setup.unshift((req: { locals?: Record<string, unknown> }) => {\n if (!req || typeof req !== \"object\") {\n throw new BadRequestError(\"req must be an object\");\n }\n // Set req.locals if it doesn't exist\n if (!req.locals) req.locals = {};\n if (typeof req.locals !== \"object\" || Array.isArray(req.locals)) {\n throw new BadRequestError(\"req.locals must be an object\");\n }\n if (!req.locals._jaypie) req.locals._jaypie = {};\n });\n const localsSetup = async (\n localsReq: { locals: Record<string, unknown> },\n localsRes: unknown,\n ) => {\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n if (typeof props.locals![key] === \"function\") {\n localsReq.locals[key] = await props.locals![key](\n localsReq,\n localsRes,\n );\n } else {\n localsReq.locals[key] = props.locals![key];\n }\n }\n };\n props.setup.push(localsSetup);\n }\n if (props.locals && typeof props.locals !== \"object\") {\n throw new BadRequestError(\"props.locals must be an object\");\n }\n if (props.locals && Array.isArray(props.locals)) {\n throw new BadRequestError(\"props.locals must be an object\");\n }\n if (props.locals === null) {\n throw new BadRequestError(\"props.locals must be an object\");\n }\n\n const jaypieFunction = jaypieHandler(handler, props);\n return async (req = {}, res = {}, ...extra: unknown[]) => {\n const status = HTTP.CODE.OK;\n let response;\n let supertestMode = false;\n\n if (\n res &&\n typeof res === \"object\" &&\n \"socket\" in res &&\n res.constructor.name === \"ServerResponse\"\n ) {\n // Use the response object in supertest mode\n supertestMode = true;\n }\n\n try {\n response = await jaypieFunction(req, res, ...extra);\n } catch (error) {\n // In the mock context, if status is a function we are in a \"supertest\"\n if (supertestMode && typeof res.status === \"function\") {\n // In theory jaypieFunction has handled all errors\n const errorStatus = error.status || HTTP.CODE.INTERNAL_ERROR;\n let errorResponse;\n if (typeof error.json === \"function\") {\n errorResponse = error.json();\n } else {\n // This should never happen\n errorResponse = new UnhandledError().json();\n }\n res.status(errorStatus).json(errorResponse);\n return;\n } else {\n // else, res.status is not a function, throw the error\n throw error;\n }\n }\n\n if (supertestMode && typeof res.status === \"function\") {\n if (response) {\n if (typeof response === \"object\") {\n if (typeof (response as WithJsonFunction).json === \"function\") {\n res.json((response as WithJsonFunction).json());\n } else {\n res.status(status).json(response);\n }\n } else if (typeof response === \"string\") {\n try {\n res.status(status).json(JSON.parse(response));\n } catch (error) {\n res.status(status).send(response);\n }\n } else if (response === true) {\n res.status(HTTP.CODE.CREATED).send();\n } else {\n res.status(status).send(response);\n }\n } else {\n res.status(HTTP.CODE.NO_CONTENT).send();\n }\n } else {\n return response;\n }\n };\n});\n","import { createMockFunction } from \"./utils\";\nimport { jaypieHandler } from \"./core\";\n\n// We'll use more specific types instead of Function\ntype HandlerFunction = (...args: unknown[]) => unknown;\ntype LifecycleFunction = (...args: unknown[]) => unknown | Promise<unknown>;\n\nexport interface LambdaOptions {\n name?: string;\n setup?: LifecycleFunction | LifecycleFunction[];\n teardown?: LifecycleFunction | LifecycleFunction[];\n throw?: boolean;\n unavailable?: boolean;\n validate?: LifecycleFunction | LifecycleFunction[];\n [key: string]: unknown;\n}\n\n// Mock implementation of lambdaHandler that follows the original implementation pattern\nexport const lambdaHandler = createMockFunction<\n (handler: HandlerFunction, props?: LambdaOptions) => HandlerFunction\n>((handler, props = {}) => {\n // If handler is an object and options is a function, swap them\n if (typeof handler === \"object\" && typeof props === \"function\") {\n const temp = handler;\n handler = props;\n props = temp;\n }\n return async (event: unknown, context: unknown, ...extra: unknown[]) => {\n return jaypieHandler(handler, props)(event, context, ...extra);\n };\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { vi } from \"vitest\";\nimport {\n createMockFunction,\n createMockResolvedFunction,\n createMockReturnedFunction,\n createMockWrappedFunction,\n createMockWrappedObject,\n} from \"./utils\";\n\nimport * as original from \"@jaypie/llm\";\n\n// Constants for mock values\nconst TAG = \"LLM\";\n\nexport const LLM = original.LLM;\n\nconst mockOperate = createMockResolvedFunction({\n history: [\n {\n content: \"_MOCK_USER_INPUT\",\n role: \"user\",\n type: \"message\",\n },\n {\n id: \"_MOCK_MESSAGE_ID\",\n type: \"message\",\n status: \"completed\",\n content: \"_MOCK_CONTENT\",\n role: \"assistant\",\n },\n ],\n output: [\n {\n id: \"_MOCK_MESSAGE_ID\",\n type: \"message\",\n status: \"completed\",\n content: \"_MOCK_CONTENT\",\n role: \"assistant\",\n },\n ],\n responses: [\n {\n id: \"_MOCK_RESPONSE_ID\",\n object: \"response\",\n created_at: Date.now() / 1000,\n status: \"completed\",\n error: null,\n output_text: \"_MOCK_OUTPUT_TEXT\",\n },\n ],\n status: \"completed\",\n usage: { input: 100, output: 20, reasoning: 0, total: 120 },\n content: \"_MOCK_OUTPUT_TEXT\",\n});\nconst mockSend = createMockResolvedFunction(\"_MOCK_LLM_RESPONSE\");\nexport const Llm = Object.assign(\n vi.fn().mockImplementation((providerName = \"_MOCK_LLM_PROVIDER\") => ({\n _provider: providerName,\n _llm: {\n operate: mockOperate,\n send: mockSend,\n },\n operate: mockOperate,\n send: mockSend,\n })),\n {\n operate: mockOperate,\n send: mockSend,\n },\n);\n\n// Tool implementations - always return mock values\nconst random = createMockReturnedFunction(0.5);\n\nconst roll = createMockReturnedFunction(6);\n\nconst time = createMockReturnedFunction(`_MOCK_TIME_[${TAG}]`);\n\nconst weather = createMockResolvedFunction({\n location: `_MOCK_WEATHER_LOCATION_[${TAG}]`,\n forecast: Array(7)\n .fill(0)\n .map((_, i) => ({\n date: `2025-05-${i + 1}`,\n temperature: 72,\n condition: \"Sunny\",\n precipitation: 0,\n })),\n});\n\n// Tool collections\nexport const toolkit = {\n random,\n roll,\n time,\n weather,\n};\n\nexport const tools = Object.values(toolkit);\n","import { createMockReturnedFunction } from \"./utils\";\n\n// Mongoose mock functions\nexport const connect = createMockReturnedFunction(true);\n\nexport const connectFromSecretEnv = createMockReturnedFunction(true);\n\nexport const disconnect = createMockReturnedFunction(true);\n\nexport { mongoose } from \"@jaypie/mongoose\";\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { readFile } from \"fs/promises\";\nimport { dirname, join } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { beforeAll, vi } from \"vitest\";\nimport { TextractDocument } from \"amazon-textract-response-parser\";\nimport type { TextractPageAdaptable } from \"@jaypie/textract\";\nimport type { JsonReturn } from \"@jaypie/types\";\nimport {\n createMockWrappedFunction,\n createMockFunction,\n createMockWrappedObject,\n} from \"./utils\";\nimport * as original from \"@jaypie/textract\";\n\n// Constants for mock values\nconst TAG = \"TEXTRACT\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst MOCK_TEXTRACT_DOCUMENT_PATH = join(__dirname, \"..\", \"mockTextract.json\");\n\n// Setup\nlet mockTextractContents: string;\nbeforeAll(async () => {\n mockTextractContents = await readFile(MOCK_TEXTRACT_DOCUMENT_PATH, \"utf-8\");\n});\n\n/**\n * Mock for MarkdownPage class from @jaypie/textract\n */\nexport const MarkdownPage = createMockWrappedObject(original.MarkdownPage, {\n class: true,\n fallback: () => {\n const mockDocument = new TextractDocument(JSON.parse(mockTextractContents));\n // Double type assertion needed to bridge incompatible types\n return new original.MarkdownPage(\n mockDocument.pageNumber(1) as unknown as TextractPageAdaptable,\n );\n },\n});\n\n/**\n * Mock for textractJsonToMarkdown function from @jaypie/textract\n */\nexport const textractJsonToMarkdown = createMockWrappedFunction<string>(\n original.textractJsonToMarkdown,\n `_MOCK_TEXTRACT_JSON_TO_MARKDOWN_[${TAG}]`,\n);\n\n// Export default for convenience\nexport default {\n MarkdownPage,\n textractJsonToMarkdown,\n};\n","// Import all mocks\nimport * as aws from \"./aws\";\nimport * as core from \"./core\";\nimport * as datadog from \"./datadog\";\nimport * as express from \"./express\";\nimport * as lambda from \"./lambda\";\nimport * as llm from \"./llm\";\nimport * as mongoose from \"./mongoose\";\nimport * as textract from \"./textract\";\n\n// Re-export all mocks\nexport * from \"./aws\";\nexport * from \"./core\";\nexport * from \"./datadog\";\nexport * from \"./express\";\nexport * from \"./lambda\";\nexport * from \"./llm\";\nexport * from \"./mongoose\";\nexport * from \"./textract\";\n\n// Export default object with all mocks\nexport default {\n // AWS module\n ...aws,\n\n // Core module\n ...core,\n\n // Datadog module\n ...datadog,\n\n // Express module\n ...express,\n\n // Lambda module\n ...lambda,\n\n // LLM module\n ...llm,\n\n // Mongoose module (now empty)\n ...mongoose,\n\n // Textract module\n ...textract,\n} as Record<string, unknown>;\n"],"names":["TAG","original","HTTP","BadRequestError","UnhandledError","textract"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAGA;;AAEG;AACH,SAAS,iBAAiB,CACxB,cAAkB,EAAA;IAElB,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC;AAClC,IAAA,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACvD,IAAA,OAAO,IAAI;AACb;AAEA;;;AAGG;AACH,SAAS,kBAAkB,CACzB,cAA0D,EAAA;;AAG1D,IAAA,OAAO,iBAAiB,CAAC,cAAc,CAAiC;AAC1E;AAEA;;;AAGG;AACH,SAAS,0BAA0B,CACjC,KAAQ,EAAA;AAER,IAAA,OAAO,iBAAiB,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC;AACrD;AAEA;;;AAGG;AACH,SAAS,0BAA0B,CAAI,KAAQ,EAAA;AAC7C,IAAA,OAAO,iBAAiB,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC;AACnD;AAEA;;;AAGG;AACH,SAAS,yBAAyB,CAChC,EAAmC,EACnC,oBAMQ,sBAAsB,EAAA;;AAG9B,IAAA,MAAM,OAAO,GACX,OAAO,iBAAiB,KAAK,QAAQ;AACrC,QAAA,iBAAiB,KAAK,IAAI;SACzB,UAAU,IAAI,iBAAiB;AAC9B,YAAA,QAAQ,IAAI,iBAAiB;YAC7B,OAAO,IAAI,iBAAiB;AAC5B,UAAE;AACF,UAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE;;AAGrC,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,sBAAsB;AAC3D,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK;AACtC,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK;IAEtC,OAAO,iBAAiB,EAAE,CAA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E;AACA,IAAI,oBAA4B;AAChC,SAAS,CAAC,YAAW;IACnB,oBAAoB,GAAG,MAAM,QAAQ,CAAC,2BAA2B,EAAE,OAAO,CAAC;AAC7E,CAAC,CAAC;AAEF;;AAEG;MACU,YAAY,GAAG,uBAAuB,CAACC,UAAQ,CAAC,YAAY,EAAE;AACzE,IAAA,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,MAAK;AACb,QAAA,MAAM,YAAY,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;;AAE3E,QAAA,OAAO,IAAIA,UAAQ,CAAC,YAAY,CAC9B,YAAY,CAAC,UAAU,CAAC,CAAC,CAAqC,CAC/D;KACF;AACF,CAAA;AAED;;AAEG;AACI,MAAM,sBAAsB,GAAG,yBAAyB,CAC7DA,UAAQ,CAAC,sBAAsB,EAC/B,CAAA,iCAAA,EAAoC,GAAG,CAAA,CAAA,CAAG;AAG5C;AACA,eAAe;IACb,YAAY;IACZ,sBAAsB;CACvB;;;;;;;;;ACxDD;AAoBA;AACA,YAAe;;AAEb,IAAA,GAAG,GAAG;;AAGN,IAAA,GAAG,IAAI;;AAGP,IAAA,GAAG,OAAO;;AAGV,IAAA,GAAG,OAAO;;AAGV,IAAA,GAAG,MAAM;;AAGT,IAAA,GAAG,GAAG;;AAGN,IAAA,GAAG,QAAQ;;AAGX,IAAA,GAAGI,UAAQ;CACe;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/mock/utils.ts","../../../src/mock/aws.ts","../../../src/mockLog.module.ts","../../../src/mock/core.ts","../../../src/mock/datadog.ts","../../../src/mock/express.ts","../../../src/mock/lambda.ts","../../../src/mock/llm.ts","../../../src/mock/mongoose.ts","../../../src/mock/textract.ts","../../../src/mock/index.ts"],"sourcesContent":["import { vi } from \"vitest\";\n\nimport { LlmTool } from \"@jaypie/llm\";\n\n/**\n * Internal wrapper for vi.fn() that adds _jaypie: true to all mocks\n */\nfunction _createJaypieMock<T extends (...args: any[]) => any>(\n implementation?: T,\n): ReturnType<typeof vi.fn> {\n const mock = vi.fn(implementation);\n Object.defineProperty(mock, \"_jaypie\", { value: true });\n return mock;\n}\n\n/**\n * Creates function mocks with proper typing\n * Internal utility to create properly typed mocks\n */\nfunction createMockFunction<T extends (...args: any[]) => any>(\n implementation?: (...args: Parameters<T>) => ReturnType<T>,\n): T & { mock: any } {\n // Use a more specific type conversion to avoid TypeScript error\n return _createJaypieMock(implementation) as unknown as T & { mock: any };\n}\n\n/**\n * Creates a mock function that resolves to a value when awaited\n * Internal utility to create async mock functions\n */\nfunction createMockResolvedFunction<T>(\n value: T,\n): (...args: unknown[]) => Promise<T> {\n return _createJaypieMock().mockResolvedValue(value);\n}\n\n/**\n * Creates a mock function that returns a value\n * Internal utility to create mock functions that return a value\n */\nfunction createMockReturnedFunction<T>(value: T): (...args: unknown[]) => T {\n return _createJaypieMock().mockReturnValue(value);\n}\n\n/**\n * Creates a mock function that wraps another function\n * Internal utility to create mock functions that wrap another function\n */\nfunction createMockWrappedFunction<T>(\n fn: (...args: unknown[]) => unknown,\n fallbackOrOptions:\n | any\n | {\n fallback?: any;\n throws?: boolean;\n class?: boolean;\n } = \"_MOCK_WRAPPED_RESULT\",\n): (...args: unknown[]) => T {\n // Determine if we have a direct fallback or options object\n const options =\n typeof fallbackOrOptions === \"object\" &&\n fallbackOrOptions !== null &&\n (\"fallback\" in fallbackOrOptions ||\n \"throws\" in fallbackOrOptions ||\n \"class\" in fallbackOrOptions)\n ? fallbackOrOptions\n : { fallback: fallbackOrOptions };\n\n // Extract values with defaults\n const fallback = options.fallback ?? \"_MOCK_WRAPPED_RESULT\";\n const throws = options.throws ?? false;\n const isClass = options.class ?? false;\n\n return _createJaypieMock().mockImplementation((...args: unknown[]) => {\n try {\n return isClass ? new (fn as any)(...args) : fn(...args);\n } catch (error) {\n if (throws) {\n throw error;\n }\n\n console.warn(\n `[@jaypie/testkit] Actual implementation failed. To suppress this warning, manually mock the response with mockReturnValue`,\n );\n if (error instanceof Error) {\n console.warn(`[@jaypie/testkit] ${error.message}`);\n }\n\n // If fallback is a function, call it\n if (typeof fallback === \"function\") {\n try {\n return fallback(...args);\n } catch (fallbackError) {\n console.warn(\n `[@jaypie/testkit] Fallback function failed: ${fallbackError instanceof Error ? fallbackError.message : fallbackError}`,\n );\n return \"_MOCK_WRAPPED_RESULT\";\n }\n }\n\n return fallback;\n }\n });\n}\n\nfunction createMockWrappedObject<T extends Record<string, any>>(\n object: T,\n fallbackOrOptions:\n | any\n | {\n fallback?: any;\n throws?: boolean;\n class?: boolean;\n } = \"_MOCK_WRAPPED_RESULT\",\n): T {\n let returnMock: Record<string, any> = {};\n\n // Extract values with defaults for the top-level call\n const options =\n typeof fallbackOrOptions === \"object\" &&\n fallbackOrOptions !== null &&\n (\"fallback\" in fallbackOrOptions ||\n \"throws\" in fallbackOrOptions ||\n \"class\" in fallbackOrOptions)\n ? fallbackOrOptions\n : { fallback: fallbackOrOptions };\n\n const fallback = options.fallback ?? \"_MOCK_WRAPPED_RESULT\";\n const throws = options.throws ?? false;\n const isClass = options.class ?? false;\n\n // Create options for recursive calls\n // Do not pass down class=true to nested objects\n const recursiveOptions = {\n fallback,\n throws,\n class: false, // Always pass class=false to nested objects\n };\n\n if (typeof object === \"function\") {\n returnMock = createMockWrappedFunction(object, {\n fallback,\n throws,\n class: isClass,\n });\n }\n for (const key of Object.keys(object)) {\n const value = object[key];\n if (typeof value === \"function\") {\n returnMock[key] = createMockWrappedFunction(value, {\n fallback,\n throws,\n class: isClass,\n });\n } else if (typeof value === \"object\" && value !== null) {\n returnMock[key] = createMockWrappedObject(value, recursiveOptions);\n } else {\n returnMock[key] = value;\n }\n }\n return returnMock as T;\n}\n\n/**\n * Utility to create a mock error constructor from an error class\n */\nfunction createMockError<T extends new (...args: any[]) => Error>(\n ErrorClass: T,\n): T {\n // Create a mock constructor that returns a new instance of ErrorClass\n const mockConstructor = _createJaypieMock(function (\n this: any,\n ...args: any[]\n ) {\n return new ErrorClass(...args);\n });\n return mockConstructor as unknown as T;\n}\n\n// Mock core errors - All error classes extend JaypieError\nclass MockValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ValidationError\";\n }\n}\n\nclass MockNotFoundError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NotFoundError\";\n }\n}\n\n/**\n * Creates a mock LlmTool for testing purposes\n * @param nameOrCallOrOptions - Name (string), call function, or full options object\n * @param callOrOptions - Call function or options object (when first param is string)\n * @returns Mock LlmTool object\n */\nfunction createMockTool(\n nameOrCallOrOptions: string | ((...args: any[]) => any) | Partial<LlmTool>,\n callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>,\n): LlmTool {\n // Default options\n const defaults: LlmTool = {\n name: \"mockTool\",\n description: \"Mock tool for testing\",\n parameters: {},\n type: \"function\",\n call: createMockResolvedFunction({ result: \"MOCK_TOOL\" }),\n message: \"MOCK_TOOL_MESSAGE\",\n };\n\n // Handle different parameter combinations\n if (typeof nameOrCallOrOptions === \"string\") {\n // First parameter is name\n const name = nameOrCallOrOptions;\n\n if (typeof callOrOptions === \"function\") {\n // Second parameter is call function\n return {\n ...defaults,\n name,\n call: callOrOptions,\n };\n } else if (callOrOptions && typeof callOrOptions === \"object\") {\n // Second parameter is options object\n return {\n ...defaults,\n name,\n ...callOrOptions,\n };\n } else {\n // Only name provided\n return {\n ...defaults,\n name,\n };\n }\n } else if (typeof nameOrCallOrOptions === \"function\") {\n // First parameter is call function\n return {\n ...defaults,\n call: nameOrCallOrOptions,\n };\n } else if (nameOrCallOrOptions && typeof nameOrCallOrOptions === \"object\") {\n // First parameter is options object\n return {\n ...defaults,\n ...nameOrCallOrOptions,\n };\n } else {\n // No parameters or invalid parameters\n return defaults;\n }\n}\n\n// Export functions for internal use\nexport {\n createMockFunction,\n createMockResolvedFunction,\n createMockReturnedFunction,\n createMockWrappedFunction,\n createMockWrappedObject,\n MockValidationError,\n MockNotFoundError,\n createMockError,\n createMockTool,\n};\n","import * as original from \"@jaypie/aws\";\nimport {\n createMockFunction,\n createMockResolvedFunction,\n createMockWrappedFunction,\n} from \"./utils\";\n\n// Constants for mock values\nconst TAG = \"AWS\";\n\nexport const getMessages = createMockWrappedFunction(original.getMessages, []);\n\nexport const getSecret = createMockResolvedFunction(\"mock-secret-value\");\n\nexport const sendMessage = createMockResolvedFunction({\n MessageId: \"mock-message-id\",\n});\n\n// Add missing functions from original implementation\nexport const getEnvSecret = createMockFunction<\n (key: string) => Promise<string>\n>(async (key) => `_MOCK_ENV_SECRET_[${TAG}][${key}]`);\n\nexport const getSingletonMessage = createMockWrappedFunction(\n original.getSingletonMessage,\n { value: \"_MOCK_SINGLETON_MESSAGE_\" },\n);\n\nexport const getTextractJob = createMockFunction<\n (jobId: string) => Promise<any>\n>(async (job) => ({ value: `_MOCK_TEXTRACT_JOB_[${job}]` }));\n\nexport const sendBatchMessages = createMockResolvedFunction(true);\n\nexport const sendTextractJob = createMockFunction<\n ({\n bucket,\n key,\n featureTypes,\n }: {\n bucket: string;\n key: string;\n featureTypes?: string[];\n snsRoleArn?: string;\n snsTopicArn?: string;\n }) => Promise<any[]>\n>(async ({ bucket, key, featureTypes = [] }) => {\n // Basic validation to mimic original behavior\n if (!bucket || !key) {\n throw new Error(\"Bucket and key are required\");\n }\n return [`_MOCK_TEXTRACT_JOB_ID_[${TAG}]_${bucket}_${key}`];\n});\n","import { log } from \"@jaypie/core\";\nimport { vi } from \"vitest\";\nimport { LogMock } from \"./types/jaypie-testkit\";\n\nexport function mockLogFactory(): LogMock {\n // Create skeleton of mock objects\n const mock = {\n debug: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n info: vi.fn(),\n init: vi.fn(),\n lib: vi.fn(),\n tag: vi.fn(),\n trace: vi.fn(),\n untag: vi.fn(),\n var: vi.fn(),\n warn: vi.fn(),\n with: vi.fn(),\n } as LogMock;\n\n // Fill out nested mocks\n mock.debug.var = mock.var;\n mock.error.var = mock.var;\n mock.fatal.var = mock.var;\n mock.info.var = mock.var;\n mock.trace.var = mock.var;\n mock.warn.var = mock.var;\n\n // Have modules return correct objects\n mock.init.mockReturnValue(null);\n mock.lib.mockReturnValue(mock);\n mock.with.mockReturnValue(mock);\n\n // Pin mocks to the module\n mock.mock = {\n debug: mock.debug,\n error: mock.error,\n fatal: mock.fatal,\n info: mock.info,\n init: mock.init,\n lib: mock.lib,\n tag: mock.tag,\n trace: mock.trace,\n untag: mock.untag,\n var: mock.var,\n warn: mock.warn,\n with: mock.with,\n };\n\n return mock;\n}\n\nconst LOG_METHOD_NAMES = [\n \"debug\",\n \"error\",\n \"fatal\",\n \"info\",\n \"init\",\n \"lib\",\n \"tag\",\n \"trace\",\n \"untag\",\n \"var\",\n \"warn\",\n \"with\",\n] as const;\n\n// Use Record type for more flexible access pattern\nconst originalLogMethods = new WeakMap<typeof log, Record<string, unknown>>();\n\nexport function spyLog(logInstance: typeof log): void {\n if (!originalLogMethods.has(logInstance)) {\n const mockLog = mockLogFactory();\n const originalMethods: Record<string, unknown> = {};\n\n // Save only methods that actually exist on the log instance\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in logInstance) {\n originalMethods[method] =\n logInstance[method as keyof typeof logInstance];\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] = mockLog[method];\n }\n });\n\n originalLogMethods.set(logInstance, originalMethods);\n }\n}\n\nexport function restoreLog(logInstance: typeof log): void {\n const originalMethods = originalLogMethods.get(logInstance);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in originalMethods && method in logInstance) {\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] =\n originalMethods[method];\n }\n });\n originalLogMethods.delete(logInstance);\n }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-function-type */\n\nimport {\n createMockError,\n createMockFunction,\n createMockResolvedFunction,\n createMockReturnedFunction,\n createMockWrappedFunction,\n createMockWrappedObject,\n} from \"./utils\";\nimport { beforeAll } from \"vitest\";\nimport { spyLog } from \"../mockLog.module.js\";\nimport { log } from \"@jaypie/core\";\nimport * as original from \"@jaypie/core\";\n\n// Constants for mock values\nconst TAG = \"CORE\";\n\nexport const BadGatewayError = createMockError(original.BadGatewayError);\nexport const BadRequestError = createMockError(original.BadRequestError);\nexport const ConfigurationError = createMockError(original.ConfigurationError);\nexport const ForbiddenError = createMockError(original.ForbiddenError);\nexport const GatewayTimeoutError = createMockError(\n original.GatewayTimeoutError,\n);\nexport const GoneError = createMockError(original.GoneError);\nexport const IllogicalError = createMockError(original.IllogicalError);\nexport const InternalError = createMockError(original.InternalError);\nexport const MethodNotAllowedError = createMockError(\n original.MethodNotAllowedError,\n);\nexport const MultiError = createMockError(original.MultiError);\nexport const NotFoundError = createMockError(original.NotFoundError);\nexport const NotImplementedError = createMockError(\n original.NotImplementedError,\n);\nexport const ProjectError = createMockError(original.ProjectError);\nexport const ProjectMultiError = createMockError(original.ProjectMultiError);\nexport const RejectedError = createMockError(original.RejectedError);\nexport const TeapotError = createMockError(original.TeapotError);\nexport const UnauthorizedError = createMockError(original.UnauthorizedError);\nexport const UnavailableError = createMockError(original.UnavailableError);\nexport const UnhandledError = createMockError(original.UnhandledError);\nexport const UnreachableCodeError = createMockError(\n original.UnreachableCodeError,\n);\n\n// Mock core functions\nexport const validate = createMockWrappedObject(original.validate, {\n fallback: false,\n throws: true,\n});\n\nbeforeAll(async () => {\n spyLog(log);\n});\nexport { log };\n\n// Add missing core functions\nexport const cloneDeep = createMockWrappedFunction(original.cloneDeep, {\n throws: true,\n});\n\nexport const envBoolean = createMockReturnedFunction(true);\n\nexport const envsKey = createMockWrappedFunction(\n original.envsKey,\n `_MOCK_ENVS_KEY_[${TAG}]`,\n);\n\nexport const errorFromStatusCode = createMockFunction<\n (statusCode: number, message?: string) => Error\n>((statusCode, message = `Mock error for status code ${statusCode}`) => {\n try {\n // Try to mimic original implementation\n switch (statusCode) {\n case 400:\n return new BadRequestError(message);\n case 401:\n return new UnauthorizedError(message);\n case 403:\n return new ForbiddenError(message);\n case 404:\n return new NotFoundError(message);\n case 405:\n return new MethodNotAllowedError(message);\n case 410:\n return new GoneError(message);\n case 418:\n return new TeapotError(message);\n case 500:\n return new InternalError(message);\n case 501:\n return new NotImplementedError(message);\n case 502:\n return new BadGatewayError(message);\n case 503:\n return new UnavailableError(message);\n case 504:\n return new GatewayTimeoutError(message);\n default:\n return new Error(message);\n }\n } catch (error) {\n return new Error(`_MOCK_ERROR_FROM_STATUS_CODE_[${TAG}][${statusCode}]`);\n }\n});\n\nexport const formatError = createMockWrappedFunction(\n original.formatError,\n `_MOCK_FORMAT_ERROR_[${TAG}]`,\n);\n\nexport const getHeaderFrom = createMockWrappedFunction(\n original.getHeaderFrom,\n `_MOCK_GET_HEADER_FROM_[${TAG}]`,\n);\n\nexport const getObjectKeyCaseInsensitive = createMockWrappedFunction(\n original.getObjectKeyCaseInsensitive,\n `_MOCK_GET_OBJECT_KEY_CASE_INSENSITIVE_[${TAG}]`,\n);\n\nexport const isClass = createMockWrappedFunction(\n original.isClass,\n `_MOCK_IS_CLASS_[${TAG}]`,\n);\n\nexport const isJaypieError = createMockWrappedFunction(\n original.isJaypieError,\n false,\n);\n\n// Optional/Required validation functions\nexport const optional = createMockWrappedObject(original.optional, {\n fallback: true,\n throws: true,\n});\n\nexport const required = createMockWrappedObject(original.required, {\n fallback: true,\n throws: true,\n});\n\nexport const resolveValue = createMockWrappedFunction(\n original.resolveValue,\n `_MOCK_RESOLVE_VALUE_[${TAG}]`,\n);\n\nexport const safeParseFloat = createMockWrappedFunction(\n original.safeParseFloat,\n `_MOCK_SAFE_PARSE_FLOAT_[${TAG}]`,\n);\n\nexport const placeholders = createMockWrappedFunction(\n original.placeholders,\n `_MOCK_PLACEHOLDERS_[${TAG}]`,\n);\n\n// Add force utilities to help with jaypieHandler implementation\nexport const force = createMockWrappedObject(original.force);\n\nexport const jaypieHandler = createMockFunction<\n (\n handler: Function,\n options?: {\n setup?: Function | Function[];\n teardown?: Function | Function[];\n unavailable?: boolean;\n validate?: Function | Function[];\n },\n ) => Function\n>((handler, options = {}) => {\n return async (...args: any[]) => {\n let result;\n let thrownError;\n\n // Destructure options with defaults\n const {\n setup = [],\n teardown = [],\n unavailable = original.force.boolean(process.env.PROJECT_UNAVAILABLE),\n validate = [],\n } = options;\n\n // Check if service is unavailable\n if (unavailable) throw new UnavailableError(\"Service unavailable\");\n\n // Run validation functions\n const validateFunctions = original.force.array(validate);\n for (const validator of validateFunctions) {\n if (typeof validator === \"function\") {\n const valid = await validator(...args);\n if (valid === false) {\n throw new BadRequestError(\"Validation failed\");\n }\n }\n }\n\n try {\n // Run setup functions\n const setupFunctions = original.force.array(setup);\n for (const setupFunction of setupFunctions) {\n if (typeof setupFunction === \"function\") {\n await setupFunction(...args);\n }\n }\n\n // Execute the handler\n result = await handler(...args);\n } catch (error) {\n thrownError = error;\n }\n\n // Run teardown functions (always run even if there was an error)\n const teardownFunctions = original.force.array(teardown);\n for (const teardownFunction of teardownFunctions) {\n if (typeof teardownFunction === \"function\") {\n try {\n await teardownFunction(...args);\n } catch (error) {\n // Swallow teardown errors, but log them\n console.error(error);\n }\n }\n }\n\n // If there was an error in the handler, throw it after teardown\n if (thrownError) {\n throw thrownError;\n }\n\n return result;\n };\n});\n\nexport const sleep = createMockResolvedFunction(true);\n\nexport const uuid = createMockWrappedFunction(\n original.uuid,\n `00000000-0000-0000-0000-000000000000`,\n);\n\nexport const ERROR = original.ERROR;\nexport const HTTP = original.HTTP;\nexport const JAYPIE = original.JAYPIE;\nexport const PROJECT = original.PROJECT;\nexport const VALIDATE = original.VALIDATE;\n","import { createMockResolvedFunction } from \"./utils\";\n\nimport * as original from \"@jaypie/datadog\";\n\nexport const DATADOG = original.DATADOG;\nexport const submitMetric = createMockResolvedFunction(true);\n\nexport const submitMetricSet = createMockResolvedFunction(true);\n","/* eslint-disable @typescript-eslint/no-unsafe-function-type */\n\nimport {\n createMockFunction,\n createMockReturnedFunction,\n createMockResolvedFunction,\n createMockWrappedFunction,\n} from \"./utils\";\nimport { BadRequestError, UnhandledError } from \"@jaypie/core\";\nimport { force, jaypieHandler } from \"./core\";\nimport * as original from \"@jaypie/express\";\n\n// Constants for mock values\nconst TAG = \"EXPRESS\";\nconst HTTP = {\n CODE: { OK: 200, CREATED: 201, NO_CONTENT: 204, INTERNAL_ERROR: 500 },\n};\n\nexport const EXPRESS = original.EXPRESS;\n\n// Add Express route functions\nexport const badRequestRoute = createMockWrappedFunction(\n original.badRequestRoute,\n { error: `_MOCK_BAD_REQUEST_ROUTE_[${TAG}]` },\n);\n\nexport const echoRoute = createMockWrappedFunction(\n original.echoRoute,\n (req) => req,\n);\n\nexport const forbiddenRoute = createMockWrappedFunction(\n original.forbiddenRoute,\n { error: `_MOCK_FORBIDDEN_ROUTE_[${TAG}]` },\n);\n\nexport const goneRoute = createMockWrappedFunction(original.goneRoute, {\n error: `_MOCK_GONE_ROUTE_[${TAG}]`,\n});\n\nexport const methodNotAllowedRoute = createMockWrappedFunction(\n original.methodNotAllowedRoute,\n { error: `_MOCK_METHOD_NOT_ALLOWED_ROUTE_[${TAG}]` },\n);\n\nexport const noContentRoute = createMockWrappedFunction(\n original.noContentRoute,\n { status: 204 },\n);\n\nexport const notFoundRoute = createMockWrappedFunction(original.notFoundRoute, {\n error: `_MOCK_NOT_FOUND_ROUTE_[${TAG}]`,\n});\n\nexport const notImplementedRoute = createMockWrappedFunction(\n original.notImplementedRoute,\n { error: `_MOCK_NOT_IMPLEMENTED_ROUTE_[${TAG}]` },\n);\n\nexport const expressHttpCodeHandler = createMockWrappedFunction(\n original.expressHttpCodeHandler,\n (...args) => {\n const [req, res, next] = args;\n return res.status(200).send();\n },\n);\n\nexport const cors = createMockWrappedFunction(original.cors);\n\n// Type definitions needed for the expressHandler\ninterface WithJsonFunction {\n json: () => any;\n}\n\nexport interface ExpressHandlerFunction {\n (req: any, res: any, ...extra: any[]): Promise<any> | any;\n}\n\nexport interface ExpressHandlerOptions {\n locals?: Record<string, any>;\n setup?: any[] | Function;\n teardown?: any[] | Function;\n unavailable?: boolean;\n validate?: any[] | Function;\n}\n\ntype ExpressHandlerParameter = ExpressHandlerFunction | ExpressHandlerOptions;\n\nexport const expressHandler = createMockFunction<\n (\n handlerOrProps: ExpressHandlerParameter,\n propsOrHandler?: ExpressHandlerParameter,\n ) => (req: any, res: any, ...extra: any[]) => Promise<any>\n>((handlerOrProps, propsOrHandler) => {\n let handler: ExpressHandlerFunction;\n let props: ExpressHandlerOptions;\n\n if (\n typeof handlerOrProps === \"object\" &&\n typeof propsOrHandler === \"function\"\n ) {\n handler = propsOrHandler;\n props = handlerOrProps;\n } else if (typeof handlerOrProps === \"function\") {\n handler = handlerOrProps;\n props = (propsOrHandler || {}) as ExpressHandlerOptions;\n } else {\n throw new BadRequestError(\"handler must be a function\");\n }\n\n // Add locals setup if needed\n if (\n props.locals &&\n typeof props.locals === \"object\" &&\n !Array.isArray(props.locals)\n ) {\n const keys = Object.keys(props.locals);\n if (!props.setup) props.setup = [];\n props.setup = force.array(props.setup);\n // @ts-expect-error TODO: cannot resolve; fix when JaypieHandler moves to TypeScript\n props.setup.unshift((req: { locals?: Record<string, unknown> }) => {\n if (!req || typeof req !== \"object\") {\n throw new BadRequestError(\"req must be an object\");\n }\n // Set req.locals if it doesn't exist\n if (!req.locals) req.locals = {};\n if (typeof req.locals !== \"object\" || Array.isArray(req.locals)) {\n throw new BadRequestError(\"req.locals must be an object\");\n }\n if (!req.locals._jaypie) req.locals._jaypie = {};\n });\n const localsSetup = async (\n localsReq: { locals: Record<string, unknown> },\n localsRes: unknown,\n ) => {\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n if (typeof props.locals![key] === \"function\") {\n localsReq.locals[key] = await props.locals![key](\n localsReq,\n localsRes,\n );\n } else {\n localsReq.locals[key] = props.locals![key];\n }\n }\n };\n props.setup.push(localsSetup);\n }\n if (props.locals && typeof props.locals !== \"object\") {\n throw new BadRequestError(\"props.locals must be an object\");\n }\n if (props.locals && Array.isArray(props.locals)) {\n throw new BadRequestError(\"props.locals must be an object\");\n }\n if (props.locals === null) {\n throw new BadRequestError(\"props.locals must be an object\");\n }\n\n const jaypieFunction = jaypieHandler(handler, props);\n return async (req = {}, res = {}, ...extra: unknown[]) => {\n const status = HTTP.CODE.OK;\n let response;\n let supertestMode = false;\n\n if (\n res &&\n typeof res === \"object\" &&\n \"socket\" in res &&\n res.constructor.name === \"ServerResponse\"\n ) {\n // Use the response object in supertest mode\n supertestMode = true;\n }\n\n try {\n response = await jaypieFunction(req, res, ...extra);\n } catch (error) {\n // In the mock context, if status is a function we are in a \"supertest\"\n if (supertestMode && typeof res.status === \"function\") {\n // In theory jaypieFunction has handled all errors\n const errorStatus = error.status || HTTP.CODE.INTERNAL_ERROR;\n let errorResponse;\n if (typeof error.json === \"function\") {\n errorResponse = error.json();\n } else {\n // This should never happen\n errorResponse = new UnhandledError().json();\n }\n res.status(errorStatus).json(errorResponse);\n return;\n } else {\n // else, res.status is not a function, throw the error\n throw error;\n }\n }\n\n if (supertestMode && typeof res.status === \"function\") {\n if (response) {\n if (typeof response === \"object\") {\n if (typeof (response as WithJsonFunction).json === \"function\") {\n res.json((response as WithJsonFunction).json());\n } else {\n res.status(status).json(response);\n }\n } else if (typeof response === \"string\") {\n try {\n res.status(status).json(JSON.parse(response));\n } catch (error) {\n res.status(status).send(response);\n }\n } else if (response === true) {\n res.status(HTTP.CODE.CREATED).send();\n } else {\n res.status(status).send(response);\n }\n } else {\n res.status(HTTP.CODE.NO_CONTENT).send();\n }\n } else {\n return response;\n }\n };\n});\n","import { createMockFunction } from \"./utils\";\nimport { jaypieHandler } from \"./core\";\n\n// We'll use more specific types instead of Function\ntype HandlerFunction = (...args: unknown[]) => unknown;\ntype LifecycleFunction = (...args: unknown[]) => unknown | Promise<unknown>;\n\nexport interface LambdaOptions {\n name?: string;\n setup?: LifecycleFunction | LifecycleFunction[];\n teardown?: LifecycleFunction | LifecycleFunction[];\n throw?: boolean;\n unavailable?: boolean;\n validate?: LifecycleFunction | LifecycleFunction[];\n [key: string]: unknown;\n}\n\n// Mock implementation of lambdaHandler that follows the original implementation pattern\nexport const lambdaHandler = createMockFunction<\n (handler: HandlerFunction, props?: LambdaOptions) => HandlerFunction\n>((handler, props = {}) => {\n // If handler is an object and options is a function, swap them\n if (typeof handler === \"object\" && typeof props === \"function\") {\n const temp = handler;\n handler = props;\n props = temp;\n }\n return async (event: unknown, context: unknown, ...extra: unknown[]) => {\n return jaypieHandler(handler, props)(event, context, ...extra);\n };\n});\n","import { vi } from \"vitest\";\nimport {\n createMockResolvedFunction,\n createMockReturnedFunction,\n createMockTool,\n createMockWrappedObject,\n} from \"./utils\";\n\nimport * as original from \"@jaypie/llm\";\n\n// Constants for mock values\nconst TAG = \"LLM\";\n\nexport const LLM = original.LLM;\n\nconst mockOperate = createMockResolvedFunction({\n history: [\n {\n content: \"_MOCK_USER_INPUT\",\n role: \"user\",\n type: \"message\",\n },\n {\n id: \"_MOCK_MESSAGE_ID\",\n type: \"message\",\n status: \"completed\",\n content: \"_MOCK_CONTENT\",\n role: \"assistant\",\n },\n ],\n output: [\n {\n id: \"_MOCK_MESSAGE_ID\",\n type: \"message\",\n status: \"completed\",\n content: \"_MOCK_CONTENT\",\n role: \"assistant\",\n },\n ],\n responses: [\n {\n id: \"_MOCK_RESPONSE_ID\",\n object: \"response\",\n created_at: Date.now() / 1000,\n status: \"completed\",\n error: null,\n output_text: \"_MOCK_OUTPUT_TEXT\",\n },\n ],\n status: \"completed\",\n usage: { input: 100, output: 20, reasoning: 0, total: 120 },\n content: \"_MOCK_OUTPUT_TEXT\",\n});\nconst mockSend = createMockResolvedFunction(\"_MOCK_LLM_RESPONSE\");\nexport const Llm = Object.assign(\n vi.fn().mockImplementation((providerName = \"_MOCK_LLM_PROVIDER\") => ({\n _provider: providerName,\n _llm: {\n operate: mockOperate,\n send: mockSend,\n },\n operate: mockOperate,\n send: mockSend,\n })),\n {\n operate: mockOperate,\n send: mockSend,\n },\n);\n\n// Tool implementations - always return mock values\nconst random = createMockTool(\"random\", createMockReturnedFunction(0.5));\n\nconst roll = createMockTool(\"roll\", createMockReturnedFunction(6));\n\nconst time = createMockTool(\"time\", createMockReturnedFunction(`_MOCK_TIME`));\n\nconst weather = createMockTool(\n \"weather\",\n createMockResolvedFunction({\n location: `_MOCK_WEATHER_LOCATION`,\n forecast: [{ conditions: \"good\" }],\n }),\n);\n\nexport const Toolkit = createMockWrappedObject(original.Toolkit, {\n isClass: true,\n});\n\n// Tool collections\nexport const toolkit = new original.Toolkit([random, roll, time, weather]);\n\nexport const tools = toolkit.tools;\n","import { createMockReturnedFunction } from \"./utils\";\n\n// Mongoose mock functions\nexport const connect = createMockReturnedFunction(true);\n\nexport const connectFromSecretEnv = createMockReturnedFunction(true);\n\nexport const disconnect = createMockReturnedFunction(true);\n\nexport { mongoose } from \"@jaypie/mongoose\";\n","import { readFile } from \"fs/promises\";\nimport { dirname, join } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { beforeAll, vi } from \"vitest\";\nimport { TextractDocument } from \"amazon-textract-response-parser\";\nimport type { TextractPageAdaptable } from \"@jaypie/textract\";\nimport type { JsonReturn } from \"@jaypie/types\";\nimport {\n createMockWrappedFunction,\n createMockFunction,\n createMockWrappedObject,\n} from \"./utils\";\nimport * as original from \"@jaypie/textract\";\n\n// Constants for mock values\nconst TAG = \"TEXTRACT\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst MOCK_TEXTRACT_DOCUMENT_PATH = join(__dirname, \"..\", \"mockTextract.json\");\n\n// Setup\nlet mockTextractContents: string;\nbeforeAll(async () => {\n mockTextractContents = await readFile(MOCK_TEXTRACT_DOCUMENT_PATH, \"utf-8\");\n});\n\n/**\n * Mock for MarkdownPage class from @jaypie/textract\n */\nexport const MarkdownPage = createMockWrappedObject(original.MarkdownPage, {\n class: true,\n fallback: () => {\n const mockDocument = new TextractDocument(JSON.parse(mockTextractContents));\n // Double type assertion needed to bridge incompatible types\n return new original.MarkdownPage(\n mockDocument.pageNumber(1) as unknown as TextractPageAdaptable,\n );\n },\n});\n\n/**\n * Mock for textractJsonToMarkdown function from @jaypie/textract\n */\nexport const textractJsonToMarkdown = createMockWrappedFunction<string>(\n original.textractJsonToMarkdown,\n `_MOCK_TEXTRACT_JSON_TO_MARKDOWN_[${TAG}]`,\n);\n\n// Export default for convenience\nexport default {\n MarkdownPage,\n textractJsonToMarkdown,\n};\n","// Import all mocks\nimport * as aws from \"./aws\";\nimport * as core from \"./core\";\nimport * as datadog from \"./datadog\";\nimport * as express from \"./express\";\nimport * as lambda from \"./lambda\";\nimport * as llm from \"./llm\";\nimport * as mongoose from \"./mongoose\";\nimport * as textract from \"./textract\";\n\n// Re-export all mocks\nexport * from \"./aws\";\nexport * from \"./core\";\nexport * from \"./datadog\";\nexport * from \"./express\";\nexport * from \"./lambda\";\nexport * from \"./llm\";\nexport * from \"./mongoose\";\nexport * from \"./textract\";\n\n// Export default object with all mocks\nexport default {\n // AWS module\n ...aws,\n\n // Core module\n ...core,\n\n // Datadog module\n ...datadog,\n\n // Express module\n ...express,\n\n // Lambda module\n ...lambda,\n\n // LLM module\n ...llm,\n\n // Mongoose module (now empty)\n ...mongoose,\n\n // Textract module\n ...textract,\n} as Record<string, unknown>;\n"],"names":["TAG","original","HTTP","BadRequestError","UnhandledError","textract"],"mappings":";;;;;;;;;;;;;;;;AAIA;;AAEG;AACH,SAAS,iBAAiB,CACxB,cAAkB,EAAA;IAElB,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC;AAClC,IAAA,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACvD,IAAA,OAAO,IAAI;AACb;AAEA;;;AAGG;AACH,SAAS,kBAAkB,CACzB,cAA0D,EAAA;;AAG1D,IAAA,OAAO,iBAAiB,CAAC,cAAc,CAAiC;AAC1E;AAEA;;;AAGG;AACH,SAAS,0BAA0B,CACjC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;;;;;;ACtDD;AAoBA;AACA,YAAe;;AAEb,IAAA,GAAG,GAAG;;AAGN,IAAA,GAAG,IAAI;;AAGP,IAAA,GAAG,OAAO;;AAGV,IAAA,GAAG,OAAO;;AAGV,IAAA,GAAG,MAAM;;AAGT,IAAA,GAAG,GAAG;;AAGN,IAAA,GAAG,QAAQ;;AAGX,IAAA,GAAGI,UAAQ;CACe;;;;"}
@@ -41,26 +41,6 @@ export declare const Llm: import("vitest").Mock<(...args: any[]) => any> & {
41
41
  }>;
42
42
  send: (...args: unknown[]) => Promise<string>;
43
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
- }>))[];
44
+ export declare const Toolkit: typeof original.Toolkit;
45
+ export declare const toolkit: original.Toolkit;
46
+ export declare const tools: Omit<original.LlmTool, "call">[];
@@ -74,6 +74,7 @@ export declare const required: {
74
74
  positive(value: unknown): value is number;
75
75
  string(value: unknown, defaultValue?: string): value is string;
76
76
  };
77
+ export declare const resolveValue: (...args: unknown[]) => unknown;
77
78
  export declare const safeParseFloat: (...args: unknown[]) => unknown;
78
79
  export declare const placeholders: (...args: unknown[]) => unknown;
79
80
  export declare const force: {
@@ -41,26 +41,6 @@ export declare const Llm: import("vitest").Mock<(...args: any[]) => any> & {
41
41
  }>;
42
42
  send: (...args: unknown[]) => Promise<string>;
43
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
- }>))[];
44
+ export declare const Toolkit: typeof original.Toolkit;
45
+ export declare const toolkit: original.Toolkit;
46
+ export declare const tools: Omit<original.LlmTool, "call">[];
@@ -1,3 +1,4 @@
1
+ import { LlmTool } from "@jaypie/llm";
1
2
  /**
2
3
  * Creates function mocks with proper typing
3
4
  * Internal utility to create properly typed mocks
@@ -39,4 +40,11 @@ declare class MockValidationError extends Error {
39
40
  declare class MockNotFoundError extends Error {
40
41
  constructor(message: string);
41
42
  }
42
- export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, };
43
+ /**
44
+ * Creates a mock LlmTool for testing purposes
45
+ * @param nameOrCallOrOptions - Name (string), call function, or full options object
46
+ * @param callOrOptions - Call function or options object (when first param is string)
47
+ * @returns Mock LlmTool object
48
+ */
49
+ declare function createMockTool(nameOrCallOrOptions: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
50
+ export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, createMockTool, };
@@ -1,3 +1,4 @@
1
+ import { LlmTool } from "@jaypie/llm";
1
2
  /**
2
3
  * Creates function mocks with proper typing
3
4
  * Internal utility to create properly typed mocks
@@ -39,4 +40,11 @@ declare class MockValidationError extends Error {
39
40
  declare class MockNotFoundError extends Error {
40
41
  constructor(message: string);
41
42
  }
42
- export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, };
43
+ /**
44
+ * Creates a mock LlmTool for testing purposes
45
+ * @param nameOrCallOrOptions - Name (string), call function, or full options object
46
+ * @param callOrOptions - Call function or options object (when first param is string)
47
+ * @returns Mock LlmTool object
48
+ */
49
+ declare function createMockTool(nameOrCallOrOptions: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
50
+ export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, createMockTool, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaypie/testkit",
3
- "version": "1.1.27",
3
+ "version": "1.1.29",
4
4
  "license": "MIT",
5
5
  "author": "Finlayson Studio",
6
6
  "type": "module",
@@ -29,16 +29,21 @@
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
31
  "dependencies": {
32
- "@jaypie/core": "^1.1.0",
32
+ "@jaypie/aws": "^1.1.21",
33
+ "@jaypie/core": "^1.1.11",
34
+ "@jaypie/datadog": "^1.1.2",
35
+ "@jaypie/express": "^1.1.11",
36
+ "@jaypie/lambda": "^1.1.4",
37
+ "@jaypie/llm": "^1.1.19",
38
+ "@jaypie/mongoose": "^1.1.1",
33
39
  "@jaypie/textract": "^0.2.4",
34
- "@jaypie/types": "^0.1.3",
35
- "jaypie": "^1.0.44",
40
+ "jaypie": "^1.1.48",
36
41
  "jest-extended": "^4.0.2",
37
42
  "jest-json-schema": "^6.1.0",
38
43
  "uuid": "^11.0.5"
39
44
  },
40
45
  "devDependencies": {
41
- "@jaypie/mongoose": "^1.1.1",
46
+ "@jaypie/types": "^0.1.7",
42
47
  "@rollup/plugin-commonjs": "^28.0.3",
43
48
  "@rollup/plugin-json": "^6.1.0",
44
49
  "@rollup/plugin-node-resolve": "^16.0.1",
@@ -56,5 +61,5 @@
56
61
  "publishConfig": {
57
62
  "access": "public"
58
63
  },
59
- "gitHead": "9bfc7a1649a4bd1d67be322e65a03e2296ca87d2"
64
+ "gitHead": "55906803c6b736acc14816401f38c39331e92bda"
60
65
  }