@impz/testing 7.5.1 → 7.6.0
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/README.md +36 -27
- package/dist/identity/create-test-identity-issuer.d.ts +23 -0
- package/dist/identity/index.d.ts +2 -0
- package/dist/identity.js +248 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2883 -2435
- package/dist/types.d.ts +39 -0
- package/package.json +8 -4
package/dist/types.d.ts
CHANGED
|
@@ -3,14 +3,53 @@ import type { ImpClient } from '@impz/client';
|
|
|
3
3
|
export interface TestImpdOptions {
|
|
4
4
|
readonly env?: Readonly<Record<string, string>>;
|
|
5
5
|
readonly onLog?: (message: string) => void;
|
|
6
|
+
readonly version?: string;
|
|
7
|
+
readonly features?: Readonly<Record<string, boolean>>;
|
|
8
|
+
}
|
|
9
|
+
export interface DefinedFault {
|
|
10
|
+
readonly code: string;
|
|
11
|
+
readonly status: number;
|
|
12
|
+
readonly message?: string;
|
|
13
|
+
readonly data?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface RawFault {
|
|
16
|
+
readonly status: number;
|
|
17
|
+
readonly body: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface FailOptions {
|
|
20
|
+
readonly times?: number;
|
|
21
|
+
readonly when?: (input: unknown) => boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface FaultHandle {
|
|
24
|
+
readonly clear: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface ExecRefusal {
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly message: string;
|
|
29
|
+
readonly data?: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface RecordedCall {
|
|
32
|
+
readonly procedure: string;
|
|
33
|
+
readonly input: unknown;
|
|
34
|
+
readonly authorization: string | null;
|
|
6
35
|
}
|
|
7
36
|
export interface TestImpd {
|
|
8
37
|
readonly url: string;
|
|
38
|
+
readonly impdUrl: string;
|
|
9
39
|
readonly client: ImpClient;
|
|
10
40
|
readonly seedImage: (name: string) => Promise<void>;
|
|
11
41
|
readonly startGuest: (impName: string) => Promise<TestGuest>;
|
|
12
42
|
readonly fireTicker: (label: string) => Promise<void>;
|
|
13
43
|
readonly stop: () => Promise<void>;
|
|
44
|
+
readonly fail: (procedure: string, answer: DefinedFault | RawFault, options?: FailOptions) => FaultHandle;
|
|
45
|
+
readonly stall: (procedure: string) => FaultHandle;
|
|
46
|
+
readonly clearFaults: () => void;
|
|
47
|
+
readonly dropConnections: () => void;
|
|
48
|
+
readonly freeze: () => void;
|
|
49
|
+
readonly thaw: () => void;
|
|
50
|
+
readonly refuseExec: (error: ExecRefusal) => void;
|
|
51
|
+
readonly closeTunnels: (code: number, reason: string) => void;
|
|
52
|
+
readonly calls: readonly RecordedCall[];
|
|
14
53
|
}
|
|
15
54
|
export interface TestGuest {
|
|
16
55
|
readonly connect: (port: number) => Promise<Duplex>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@impz/testing",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"description": "A real impd on stand-ins, for Bun tests of code that drives impd through @impz/client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./identity": {
|
|
18
|
+
"types": "./dist/identity/index.d.ts",
|
|
19
|
+
"default": "./dist/identity.js"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"dependencies": {
|
|
@@ -27,9 +31,9 @@
|
|
|
27
31
|
"@orpc/openapi-client": "^1.16.1",
|
|
28
32
|
"@orpc/server": "^1.16.1",
|
|
29
33
|
"@peculiar/x509": "^2.2.0",
|
|
30
|
-
"@zgeoff/kysely-bun-sqlite": "^0.3.
|
|
34
|
+
"@zgeoff/kysely-bun-sqlite": "^0.3.3",
|
|
31
35
|
"@zgeoff/mcp-auth": "^0.2.2",
|
|
32
|
-
"@zgeoff/std": "^0.4.
|
|
36
|
+
"@zgeoff/std": "^0.4.4",
|
|
33
37
|
"dns-packet": "^5.6.1",
|
|
34
38
|
"elysia": "^2.0.0-rc.3",
|
|
35
39
|
"ipaddr.js": "^2.5.0",
|
|
@@ -42,7 +46,7 @@
|
|
|
42
46
|
"ts-pattern": "^5.9.2",
|
|
43
47
|
"xstate": "^5.33.3",
|
|
44
48
|
"zod": "^4.6.7",
|
|
45
|
-
"@impz/client": "7.
|
|
49
|
+
"@impz/client": "7.6.0"
|
|
46
50
|
},
|
|
47
51
|
"engines": {
|
|
48
52
|
"bun": ">=1.4.3"
|