@jaypie/testkit 1.1.34 → 1.1.36

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.
@@ -2,9 +2,11 @@ export * from "./aws";
2
2
  export * from "./core";
3
3
  export * from "./datadog";
4
4
  export * from "./express";
5
+ export * from "./kit";
5
6
  export * from "./lambda";
6
7
  export * from "./llm";
8
+ export * from "./logger";
7
9
  export * from "./mongoose";
8
10
  export * from "./textract";
9
- declare const _default: Record<string, unknown>;
10
- export default _default;
11
+ declare const mock: Record<string, any>;
12
+ export default mock;
@@ -0,0 +1,2 @@
1
+ export declare const isProductionEnv: import("vitest").Mock<(...args: any[]) => any>;
2
+ export declare const isNodeTestEnv: import("vitest").Mock<(...args: any[]) => any>;
@@ -1,53 +1,14 @@
1
1
  import * as original from "@jaypie/llm";
2
2
  export declare const LLM: typeof original.LLM;
3
3
  export declare const Llm: import("vitest").Mock<(...args: any[]) => any> & {
4
- operate: (...args: unknown[]) => Promise<{
5
- history: ({
6
- content: string;
7
- role: string;
8
- type: string;
9
- id?: undefined;
10
- status?: undefined;
11
- } | {
12
- id: string;
13
- type: string;
14
- status: string;
15
- content: string;
16
- role: string;
17
- })[];
18
- model: string;
19
- output: {
20
- id: string;
21
- type: string;
22
- status: string;
23
- content: string;
24
- role: string;
25
- }[];
26
- provider: string;
27
- responses: {
28
- id: string;
29
- object: string;
30
- created_at: number;
31
- status: string;
32
- error: null;
33
- output_text: string;
34
- }[];
35
- status: string;
36
- usage: {
37
- input: number;
38
- output: number;
39
- reasoning: number;
40
- total: number;
41
- provider: string;
42
- model: string;
43
- }[];
44
- content: string;
45
- }>;
46
- send: (...args: unknown[]) => Promise<string>;
4
+ operate: import("vitest").Mock<(...args: any[]) => any>;
5
+ send: import("vitest").Mock<(...args: any[]) => any>;
47
6
  };
48
7
  export declare const Toolkit: typeof original.Toolkit;
49
8
  export declare const JaypieToolkit: typeof original.JaypieToolkit;
50
9
  export declare const LlmMessageRole: typeof original.LlmMessageRole;
51
10
  export declare const LlmMessageType: typeof original.LlmMessageType;
11
+ export declare const GeminiProvider: typeof original.GeminiProvider;
12
+ export declare const OpenRouterProvider: typeof original.OpenRouterProvider;
52
13
  export declare const toolkit: original.JaypieToolkit;
53
14
  export declare const tools: Omit<original.LlmTool, "call">[];
@@ -0,0 +1,5 @@
1
+ import { FORMAT, LEVEL, Logger } from "@jaypie/logger";
2
+ declare const mockLog: import("../types").LogMock;
3
+ export declare const createLogger: import("vitest").Mock<(...args: any[]) => any>;
4
+ export { FORMAT, LEVEL, Logger };
5
+ export default mockLog;
@@ -1,4 +1,4 @@
1
- export declare const connect: (...args: unknown[]) => boolean;
2
- export declare const connectFromSecretEnv: (...args: unknown[]) => boolean;
3
- export declare const disconnect: (...args: unknown[]) => boolean;
1
+ export declare const connect: import("vitest").Mock<(...args: any[]) => any>;
2
+ export declare const connectFromSecretEnv: import("vitest").Mock<(...args: any[]) => any>;
3
+ export declare const disconnect: import("vitest").Mock<(...args: any[]) => any>;
4
4
  export { mongoose } from "@jaypie/mongoose";
@@ -2,8 +2,10 @@ import * as aws from "@jaypie/aws";
2
2
  import * as core from "@jaypie/core";
3
3
  import * as datadog from "@jaypie/datadog";
4
4
  import * as express from "@jaypie/express";
5
+ import * as kit from "@jaypie/kit";
5
6
  import * as lambda from "@jaypie/lambda";
6
7
  import * as llm from "@jaypie/llm";
8
+ import * as logger from "@jaypie/logger";
7
9
  import * as mongoose from "@jaypie/mongoose";
8
10
  import * as textract from "@jaypie/textract";
9
11
  export declare const original: {
@@ -11,8 +13,10 @@ export declare const original: {
11
13
  core: typeof core;
12
14
  datadog: typeof datadog;
13
15
  express: typeof express;
16
+ kit: typeof kit;
14
17
  lambda: typeof lambda;
15
18
  llm: typeof llm;
19
+ logger: typeof logger;
16
20
  mongoose: typeof mongoose;
17
21
  textract: typeof textract;
18
22
  };
@@ -6,9 +6,9 @@ export declare const MarkdownPage: typeof original.MarkdownPage;
6
6
  /**
7
7
  * Mock for textractJsonToMarkdown function from @jaypie/textract
8
8
  */
9
- export declare const textractJsonToMarkdown: (...args: unknown[]) => string;
9
+ export declare const textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
10
10
  declare const _default: {
11
11
  MarkdownPage: typeof original.MarkdownPage;
12
- textractJsonToMarkdown: (...args: unknown[]) => string;
12
+ textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
13
13
  };
14
14
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { vi } from "vitest";
1
2
  import { LlmTool } from "@jaypie/llm";
2
3
  /**
3
4
  * Creates function mocks with proper typing
@@ -10,21 +11,21 @@ declare function createMockFunction<T extends (...args: any[]) => any>(implement
10
11
  * Creates a mock function that resolves to a value when awaited
11
12
  * Internal utility to create async mock functions
12
13
  */
13
- declare function createMockResolvedFunction<T>(value: T): (...args: unknown[]) => Promise<T>;
14
+ declare function createMockResolvedFunction<T>(value: T): ReturnType<typeof vi.fn>;
14
15
  /**
15
16
  * Creates a mock function that returns a value
16
17
  * Internal utility to create mock functions that return a value
17
18
  */
18
- declare function createMockReturnedFunction<T>(value: T): (...args: unknown[]) => T;
19
+ declare function createMockReturnedFunction<T>(value: T): ReturnType<typeof vi.fn>;
19
20
  /**
20
21
  * Creates a mock function that wraps another function
21
22
  * Internal utility to create mock functions that wrap another function
22
23
  */
23
- declare function createMockWrappedFunction<T>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
24
+ declare function createMockWrappedFunction<T = any>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
24
25
  fallback?: any;
25
26
  throws?: boolean;
26
27
  class?: boolean;
27
- }): (...args: unknown[]) => T;
28
+ }): ReturnType<typeof vi.fn>;
28
29
  declare function createMockWrappedObject<T extends Record<string, any>>(object: T, fallbackOrOptions?: any | {
29
30
  fallback?: any;
30
31
  throws?: boolean;
@@ -46,5 +47,5 @@ declare class MockNotFoundError extends Error {
46
47
  * @param callOrOptions - Call function or options object (when first param is string)
47
48
  * @returns Mock LlmTool object
48
49
  */
49
- declare function createMockTool(nameOrCallOrOptions: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
50
+ declare function createMockTool(nameOrCallOrOptions?: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
50
51
  export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, createMockTool, };
@@ -1,4 +1,4 @@
1
- export declare const connect: (...args: unknown[]) => boolean;
2
- export declare const connectFromSecretEnv: (...args: unknown[]) => boolean;
3
- export declare const disconnect: (...args: unknown[]) => boolean;
1
+ export declare const connect: import("vitest").Mock<(...args: any[]) => any>;
2
+ export declare const connectFromSecretEnv: import("vitest").Mock<(...args: any[]) => any>;
3
+ export declare const disconnect: import("vitest").Mock<(...args: any[]) => any>;
4
4
  export { mongoose } from "@jaypie/mongoose";
@@ -2,8 +2,10 @@ import * as aws from "@jaypie/aws";
2
2
  import * as core from "@jaypie/core";
3
3
  import * as datadog from "@jaypie/datadog";
4
4
  import * as express from "@jaypie/express";
5
+ import * as kit from "@jaypie/kit";
5
6
  import * as lambda from "@jaypie/lambda";
6
7
  import * as llm from "@jaypie/llm";
8
+ import * as logger from "@jaypie/logger";
7
9
  import * as mongoose from "@jaypie/mongoose";
8
10
  import * as textract from "@jaypie/textract";
9
11
  export declare const original: {
@@ -11,8 +13,10 @@ export declare const original: {
11
13
  core: typeof core;
12
14
  datadog: typeof datadog;
13
15
  express: typeof express;
16
+ kit: typeof kit;
14
17
  lambda: typeof lambda;
15
18
  llm: typeof llm;
19
+ logger: typeof logger;
16
20
  mongoose: typeof mongoose;
17
21
  textract: typeof textract;
18
22
  };
@@ -6,9 +6,9 @@ export declare const MarkdownPage: typeof original.MarkdownPage;
6
6
  /**
7
7
  * Mock for textractJsonToMarkdown function from @jaypie/textract
8
8
  */
9
- export declare const textractJsonToMarkdown: (...args: unknown[]) => string;
9
+ export declare const textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
10
10
  declare const _default: {
11
11
  MarkdownPage: typeof original.MarkdownPage;
12
- textractJsonToMarkdown: (...args: unknown[]) => string;
12
+ textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
13
13
  };
14
14
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { vi } from "vitest";
1
2
  import { LlmTool } from "@jaypie/llm";
2
3
  /**
3
4
  * Creates function mocks with proper typing
@@ -10,21 +11,21 @@ declare function createMockFunction<T extends (...args: any[]) => any>(implement
10
11
  * Creates a mock function that resolves to a value when awaited
11
12
  * Internal utility to create async mock functions
12
13
  */
13
- declare function createMockResolvedFunction<T>(value: T): (...args: unknown[]) => Promise<T>;
14
+ declare function createMockResolvedFunction<T>(value: T): ReturnType<typeof vi.fn>;
14
15
  /**
15
16
  * Creates a mock function that returns a value
16
17
  * Internal utility to create mock functions that return a value
17
18
  */
18
- declare function createMockReturnedFunction<T>(value: T): (...args: unknown[]) => T;
19
+ declare function createMockReturnedFunction<T>(value: T): ReturnType<typeof vi.fn>;
19
20
  /**
20
21
  * Creates a mock function that wraps another function
21
22
  * Internal utility to create mock functions that wrap another function
22
23
  */
23
- declare function createMockWrappedFunction<T>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
24
+ declare function createMockWrappedFunction<T = any>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
24
25
  fallback?: any;
25
26
  throws?: boolean;
26
27
  class?: boolean;
27
- }): (...args: unknown[]) => T;
28
+ }): ReturnType<typeof vi.fn>;
28
29
  declare function createMockWrappedObject<T extends Record<string, any>>(object: T, fallbackOrOptions?: any | {
29
30
  fallback?: any;
30
31
  throws?: boolean;
@@ -46,5 +47,5 @@ declare class MockNotFoundError extends Error {
46
47
  * @param callOrOptions - Call function or options object (when first param is string)
47
48
  * @returns Mock LlmTool object
48
49
  */
49
- declare function createMockTool(nameOrCallOrOptions: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
50
+ declare function createMockTool(nameOrCallOrOptions?: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
50
51
  export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, createMockTool, };
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@jaypie/testkit",
3
- "version": "1.1.34",
3
+ "version": "1.1.36",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/finlaysonstudio/jaypie"
7
+ },
4
8
  "license": "MIT",
5
9
  "author": "Finlayson Studio",
6
10
  "type": "module",
@@ -39,7 +43,7 @@
39
43
  "@jaypie/logger": "^1.1.0",
40
44
  "@jaypie/mongoose": "^1.1.1",
41
45
  "@jaypie/textract": "^0.2.4",
42
- "jaypie": "^1.1.48",
46
+ "jaypie": "^1.1.71",
43
47
  "jest-extended": "^4.0.2",
44
48
  "jest-json-schema": "^6.1.0",
45
49
  "uuid": "^11.0.5"
@@ -63,5 +67,5 @@
63
67
  "publishConfig": {
64
68
  "access": "public"
65
69
  },
66
- "gitHead": "85769efb6474ef6dda324c0e0056bef1fbd13558"
70
+ "gitHead": "45fe048c6687a807ed52bbc0b25963f45450f9c9"
67
71
  }