@zze/mock-server 0.2.6 → 0.5.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 +117 -28
- package/dist/__tests__/mock-server.test.js +52 -0
- package/dist/admin/__tests__/admin-router.test.js +0 -151
- package/dist/admin/admin-router.d.ts.map +1 -1
- package/dist/admin/admin-router.js +0 -205
- package/dist/admin/types.d.ts +0 -84
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js +1 -5
- package/dist/config/config-writer.d.ts +1 -35
- package/dist/config/config-writer.d.ts.map +1 -1
- package/dist/config/config-writer.js +0 -103
- package/dist/mock-server.d.ts +9 -0
- package/dist/mock-server.d.ts.map +1 -1
- package/dist/mock-server.js +3 -0
- package/dist/resolver/__tests__/response-resolver.test.js +134 -0
- package/dist/resolver/response-resolver.d.ts +18 -2
- package/dist/resolver/response-resolver.d.ts.map +1 -1
- package/dist/resolver/response-resolver.js +62 -5
- package/dist/resolver/types.d.ts +8 -0
- package/dist/resolver/types.d.ts.map +1 -1
- package/dist/resolver/types.js +7 -0
- package/dist/schemas/__tests__/endpoint.schema.test.js +48 -0
- package/dist/schemas/endpoint.schema.d.ts +31 -8
- package/dist/schemas/endpoint.schema.d.ts.map +1 -1
- package/dist/schemas/scenario.schema.d.ts +28 -4
- package/dist/schemas/scenario.schema.d.ts.map +1 -1
- package/dist/schemas/scenario.schema.js +23 -3
- package/dist/server/__tests__/mock-server-app.test.js +37 -0
- package/dist/server/mock-server-app.d.ts.map +1 -1
- package/dist/server/mock-server-app.js +5 -1
- package/dist/server/types.d.ts +8 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js +1 -0
- package/dist/ui/assets/{index-rj7m-XdG.css → index-C5BZSa2z.css} +1 -1
- package/dist/ui/assets/index-DY4CS66u.js +9 -0
- package/dist/ui/index.html +2 -2
- package/package.json +6 -4
- package/dist/ui/assets/index-SADMOgPE.js +0 -10
package/dist/admin/types.d.ts
CHANGED
|
@@ -24,90 +24,6 @@ export declare const ActivateFlowRequestSchema: z.ZodObject<{
|
|
|
24
24
|
flowId: string | null;
|
|
25
25
|
}>;
|
|
26
26
|
export type ActivateFlowRequest = z.infer<typeof ActivateFlowRequestSchema>;
|
|
27
|
-
/**
|
|
28
|
-
* Request body for creating/updating an endpoint
|
|
29
|
-
*/
|
|
30
|
-
export declare const EndpointRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
31
|
-
id: z.ZodString;
|
|
32
|
-
path: z.ZodString;
|
|
33
|
-
method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]>;
|
|
34
|
-
scenarios: z.ZodArray<z.ZodObject<{
|
|
35
|
-
id: z.ZodString;
|
|
36
|
-
name: z.ZodString;
|
|
37
|
-
status: z.ZodNumber;
|
|
38
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
|
-
body: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>]>;
|
|
40
|
-
delay: z.ZodOptional<z.ZodNumber>;
|
|
41
|
-
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
status: number;
|
|
43
|
-
id: string;
|
|
44
|
-
name: string;
|
|
45
|
-
body: string | number | boolean | unknown[] | Record<string, unknown> | ((args_0: any, ...args: unknown[]) => any) | null;
|
|
46
|
-
headers?: Record<string, string> | undefined;
|
|
47
|
-
delay?: number | undefined;
|
|
48
|
-
}, {
|
|
49
|
-
status: number;
|
|
50
|
-
id: string;
|
|
51
|
-
name: string;
|
|
52
|
-
body: string | number | boolean | unknown[] | Record<string, unknown> | ((args_0: any, ...args: unknown[]) => any) | null;
|
|
53
|
-
headers?: Record<string, string> | undefined;
|
|
54
|
-
delay?: number | undefined;
|
|
55
|
-
}>, "many">;
|
|
56
|
-
defaultScenarioId: z.ZodString;
|
|
57
|
-
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
path: string;
|
|
59
|
-
id: string;
|
|
60
|
-
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
61
|
-
scenarios: {
|
|
62
|
-
status: number;
|
|
63
|
-
id: string;
|
|
64
|
-
name: string;
|
|
65
|
-
body: string | number | boolean | unknown[] | Record<string, unknown> | ((args_0: any, ...args: unknown[]) => any) | null;
|
|
66
|
-
headers?: Record<string, string> | undefined;
|
|
67
|
-
delay?: number | undefined;
|
|
68
|
-
}[];
|
|
69
|
-
defaultScenarioId: string;
|
|
70
|
-
}, {
|
|
71
|
-
path: string;
|
|
72
|
-
id: string;
|
|
73
|
-
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
74
|
-
scenarios: {
|
|
75
|
-
status: number;
|
|
76
|
-
id: string;
|
|
77
|
-
name: string;
|
|
78
|
-
body: string | number | boolean | unknown[] | Record<string, unknown> | ((args_0: any, ...args: unknown[]) => any) | null;
|
|
79
|
-
headers?: Record<string, string> | undefined;
|
|
80
|
-
delay?: number | undefined;
|
|
81
|
-
}[];
|
|
82
|
-
defaultScenarioId: string;
|
|
83
|
-
}>, {
|
|
84
|
-
path: string;
|
|
85
|
-
id: string;
|
|
86
|
-
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
87
|
-
scenarios: {
|
|
88
|
-
status: number;
|
|
89
|
-
id: string;
|
|
90
|
-
name: string;
|
|
91
|
-
body: string | number | boolean | unknown[] | Record<string, unknown> | ((args_0: any, ...args: unknown[]) => any) | null;
|
|
92
|
-
headers?: Record<string, string> | undefined;
|
|
93
|
-
delay?: number | undefined;
|
|
94
|
-
}[];
|
|
95
|
-
defaultScenarioId: string;
|
|
96
|
-
}, {
|
|
97
|
-
path: string;
|
|
98
|
-
id: string;
|
|
99
|
-
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
100
|
-
scenarios: {
|
|
101
|
-
status: number;
|
|
102
|
-
id: string;
|
|
103
|
-
name: string;
|
|
104
|
-
body: string | number | boolean | unknown[] | Record<string, unknown> | ((args_0: any, ...args: unknown[]) => any) | null;
|
|
105
|
-
headers?: Record<string, string> | undefined;
|
|
106
|
-
delay?: number | undefined;
|
|
107
|
-
}[];
|
|
108
|
-
defaultScenarioId: string;
|
|
109
|
-
}>;
|
|
110
|
-
export type EndpointRequest = z.infer<typeof EndpointRequestSchema>;
|
|
111
27
|
/**
|
|
112
28
|
* Request body for creating/updating a flow
|
|
113
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/admin/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/admin/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;EAEp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|
package/dist/admin/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DuplicateFlowRequestSchema = exports.FlowRequestSchema = exports.
|
|
3
|
+
exports.DuplicateFlowRequestSchema = exports.FlowRequestSchema = exports.ActivateFlowRequestSchema = exports.ActivateScenarioRequestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const index_js_1 = require("../schemas/index.js");
|
|
6
6
|
/**
|
|
@@ -16,10 +16,6 @@ exports.ActivateScenarioRequestSchema = zod_1.z.object({
|
|
|
16
16
|
exports.ActivateFlowRequestSchema = zod_1.z.object({
|
|
17
17
|
flowId: zod_1.z.string().min(1).nullable(),
|
|
18
18
|
});
|
|
19
|
-
/**
|
|
20
|
-
* Request body for creating/updating an endpoint
|
|
21
|
-
*/
|
|
22
|
-
exports.EndpointRequestSchema = index_js_1.EndpointConfigSchema;
|
|
23
19
|
/**
|
|
24
20
|
* Request body for creating/updating a flow
|
|
25
21
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config file writer - handles persisting endpoint and flow configs to disk
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { FlowConfig } from '../schemas/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Result of a write operation
|
|
7
7
|
*/
|
|
@@ -26,38 +26,18 @@ export declare class ConfigWriter {
|
|
|
26
26
|
private endpointsDir;
|
|
27
27
|
private flowsDir;
|
|
28
28
|
constructor(options: ConfigWriterOptions);
|
|
29
|
-
/**
|
|
30
|
-
* Get the file path for an endpoint config
|
|
31
|
-
*/
|
|
32
|
-
getEndpointFilePath(endpointId: string): string;
|
|
33
29
|
/**
|
|
34
30
|
* Get the file path for a flow config
|
|
35
31
|
*/
|
|
36
32
|
getFlowFilePath(flowId: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* Check if an endpoint file exists
|
|
39
|
-
*/
|
|
40
|
-
endpointExists(endpointId: string): Promise<boolean>;
|
|
41
33
|
/**
|
|
42
34
|
* Check if a flow file exists
|
|
43
35
|
*/
|
|
44
36
|
flowExists(flowId: string): Promise<boolean>;
|
|
45
|
-
/**
|
|
46
|
-
* Find an existing endpoint file by ID (could be .json, .js, or .ts)
|
|
47
|
-
*/
|
|
48
|
-
findEndpointFile(endpointId: string): Promise<string | null>;
|
|
49
37
|
/**
|
|
50
38
|
* Find an existing flow file by ID (could be .json, .js, or .ts)
|
|
51
39
|
*/
|
|
52
40
|
findFlowFile(flowId: string): Promise<string | null>;
|
|
53
|
-
/**
|
|
54
|
-
* Validate an endpoint config
|
|
55
|
-
*/
|
|
56
|
-
validateEndpoint(data: unknown): {
|
|
57
|
-
success: boolean;
|
|
58
|
-
data?: EndpointConfig;
|
|
59
|
-
error?: string;
|
|
60
|
-
};
|
|
61
41
|
/**
|
|
62
42
|
* Validate a flow config
|
|
63
43
|
*/
|
|
@@ -66,28 +46,14 @@ export declare class ConfigWriter {
|
|
|
66
46
|
data?: FlowConfig;
|
|
67
47
|
error?: string;
|
|
68
48
|
};
|
|
69
|
-
/**
|
|
70
|
-
* Write an endpoint config to disk
|
|
71
|
-
* Creates a new file or overwrites existing .json file
|
|
72
|
-
*/
|
|
73
|
-
writeEndpoint(endpoint: EndpointConfig): Promise<WriteResult>;
|
|
74
49
|
/**
|
|
75
50
|
* Write a flow config to disk
|
|
76
51
|
*/
|
|
77
52
|
writeFlow(flow: FlowConfig): Promise<WriteResult>;
|
|
78
|
-
/**
|
|
79
|
-
* Delete an endpoint file
|
|
80
|
-
*/
|
|
81
|
-
deleteEndpoint(endpointId: string): Promise<WriteResult>;
|
|
82
53
|
/**
|
|
83
54
|
* Delete a flow file
|
|
84
55
|
*/
|
|
85
56
|
deleteFlow(flowId: string): Promise<WriteResult>;
|
|
86
|
-
/**
|
|
87
|
-
* Clean endpoint data for JSON serialization
|
|
88
|
-
* Converts function bodies to null (they can't be serialized)
|
|
89
|
-
*/
|
|
90
|
-
private cleanEndpointForJson;
|
|
91
57
|
}
|
|
92
58
|
/**
|
|
93
59
|
* Create a ConfigWriter instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/config/config-writer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/config/config-writer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,EAAE,mBAAmB;IAKxC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAIvC;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUlD;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAc1D;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IASpF;;OAEG;IACG,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAoBvD;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAkBvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAE7E"}
|
|
@@ -49,31 +49,12 @@ class ConfigWriter {
|
|
|
49
49
|
this.endpointsDir = options.endpointsDir;
|
|
50
50
|
this.flowsDir = options.flowsDir;
|
|
51
51
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Get the file path for an endpoint config
|
|
54
|
-
*/
|
|
55
|
-
getEndpointFilePath(endpointId) {
|
|
56
|
-
return path.join(this.endpointsDir, `${endpointId}.json`);
|
|
57
|
-
}
|
|
58
52
|
/**
|
|
59
53
|
* Get the file path for a flow config
|
|
60
54
|
*/
|
|
61
55
|
getFlowFilePath(flowId) {
|
|
62
56
|
return path.join(this.flowsDir, `${flowId}.json`);
|
|
63
57
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Check if an endpoint file exists
|
|
66
|
-
*/
|
|
67
|
-
async endpointExists(endpointId) {
|
|
68
|
-
const filePath = this.getEndpointFilePath(endpointId);
|
|
69
|
-
try {
|
|
70
|
-
await fs.access(filePath);
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
58
|
/**
|
|
78
59
|
* Check if a flow file exists
|
|
79
60
|
*/
|
|
@@ -87,23 +68,6 @@ class ConfigWriter {
|
|
|
87
68
|
return false;
|
|
88
69
|
}
|
|
89
70
|
}
|
|
90
|
-
/**
|
|
91
|
-
* Find an existing endpoint file by ID (could be .json, .js, or .ts)
|
|
92
|
-
*/
|
|
93
|
-
async findEndpointFile(endpointId) {
|
|
94
|
-
const extensions = ['.json', '.js', '.ts', '.mjs', '.mts'];
|
|
95
|
-
for (const ext of extensions) {
|
|
96
|
-
const filePath = path.join(this.endpointsDir, `${endpointId}${ext}`);
|
|
97
|
-
try {
|
|
98
|
-
await fs.access(filePath);
|
|
99
|
-
return filePath;
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
// Continue checking
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
71
|
/**
|
|
108
72
|
* Find an existing flow file by ID (could be .json, .js, or .ts)
|
|
109
73
|
*/
|
|
@@ -121,17 +85,6 @@ class ConfigWriter {
|
|
|
121
85
|
}
|
|
122
86
|
return null;
|
|
123
87
|
}
|
|
124
|
-
/**
|
|
125
|
-
* Validate an endpoint config
|
|
126
|
-
*/
|
|
127
|
-
validateEndpoint(data) {
|
|
128
|
-
const result = index_js_1.EndpointConfigSchema.safeParse(data);
|
|
129
|
-
if (result.success) {
|
|
130
|
-
return { success: true, data: result.data };
|
|
131
|
-
}
|
|
132
|
-
const errors = result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ');
|
|
133
|
-
return { success: false, error: errors };
|
|
134
|
-
}
|
|
135
88
|
/**
|
|
136
89
|
* Validate a flow config
|
|
137
90
|
*/
|
|
@@ -143,29 +96,6 @@ class ConfigWriter {
|
|
|
143
96
|
const errors = result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ');
|
|
144
97
|
return { success: false, error: errors };
|
|
145
98
|
}
|
|
146
|
-
/**
|
|
147
|
-
* Write an endpoint config to disk
|
|
148
|
-
* Creates a new file or overwrites existing .json file
|
|
149
|
-
*/
|
|
150
|
-
async writeEndpoint(endpoint) {
|
|
151
|
-
const filePath = this.getEndpointFilePath(endpoint.id);
|
|
152
|
-
try {
|
|
153
|
-
// Ensure directory exists
|
|
154
|
-
await fs.mkdir(this.endpointsDir, { recursive: true });
|
|
155
|
-
// Prepare clean endpoint data (remove function bodies for JSON)
|
|
156
|
-
const cleanEndpoint = this.cleanEndpointForJson(endpoint);
|
|
157
|
-
// Write formatted JSON
|
|
158
|
-
const content = JSON.stringify(cleanEndpoint, null, 2) + '\n';
|
|
159
|
-
await fs.writeFile(filePath, content, 'utf-8');
|
|
160
|
-
return { success: true, filePath };
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
return {
|
|
164
|
-
success: false,
|
|
165
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
99
|
/**
|
|
170
100
|
* Write a flow config to disk
|
|
171
101
|
*/
|
|
@@ -186,25 +116,6 @@ class ConfigWriter {
|
|
|
186
116
|
};
|
|
187
117
|
}
|
|
188
118
|
}
|
|
189
|
-
/**
|
|
190
|
-
* Delete an endpoint file
|
|
191
|
-
*/
|
|
192
|
-
async deleteEndpoint(endpointId) {
|
|
193
|
-
const existingFile = await this.findEndpointFile(endpointId);
|
|
194
|
-
if (!existingFile) {
|
|
195
|
-
return { success: false, error: `Endpoint "${endpointId}" not found` };
|
|
196
|
-
}
|
|
197
|
-
try {
|
|
198
|
-
await fs.unlink(existingFile);
|
|
199
|
-
return { success: true, filePath: existingFile };
|
|
200
|
-
}
|
|
201
|
-
catch (error) {
|
|
202
|
-
return {
|
|
203
|
-
success: false,
|
|
204
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
119
|
/**
|
|
209
120
|
* Delete a flow file
|
|
210
121
|
*/
|
|
@@ -224,20 +135,6 @@ class ConfigWriter {
|
|
|
224
135
|
};
|
|
225
136
|
}
|
|
226
137
|
}
|
|
227
|
-
/**
|
|
228
|
-
* Clean endpoint data for JSON serialization
|
|
229
|
-
* Converts function bodies to null (they can't be serialized)
|
|
230
|
-
*/
|
|
231
|
-
cleanEndpointForJson(endpoint) {
|
|
232
|
-
return {
|
|
233
|
-
...endpoint,
|
|
234
|
-
scenarios: endpoint.scenarios.map((scenario) => ({
|
|
235
|
-
...scenario,
|
|
236
|
-
// If body is a function, convert to a placeholder or keep as-is for objects
|
|
237
|
-
body: typeof scenario.body === 'function' ? { _note: 'Function body - edit in .ts file' } : scenario.body,
|
|
238
|
-
})),
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
138
|
}
|
|
242
139
|
exports.ConfigWriter = ConfigWriter;
|
|
243
140
|
/**
|
package/dist/mock-server.d.ts
CHANGED
|
@@ -38,6 +38,15 @@ export interface MockServerOptions {
|
|
|
38
38
|
* Options for the file watcher (only used when hotReload is true).
|
|
39
39
|
*/
|
|
40
40
|
watcherOptions?: WatcherOptions;
|
|
41
|
+
/**
|
|
42
|
+
* Global delay applied to every response when the matched scenario has no explicit `delay`.
|
|
43
|
+
* A number is a fixed millisecond value; a tuple [min, max] produces a random value in that range.
|
|
44
|
+
* Scenario-level `delay` always takes precedence.
|
|
45
|
+
* @example
|
|
46
|
+
* globalDelay: 200 // every response waits 200 ms (unless scenario overrides)
|
|
47
|
+
* globalDelay: [100, 500] // each response waits a random 100-500 ms
|
|
48
|
+
*/
|
|
49
|
+
globalDelay?: number | [number, number];
|
|
41
50
|
}
|
|
42
51
|
/**
|
|
43
52
|
* Current state of the mock server
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-server.d.ts","sourceRoot":"","sources":["../src/mock-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EA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vB;;;;OAIG;IACH,UAAU,IAAI,iBAAiB;IAI/B;;;;;;;OAOG;IACH,MAAM,IAAI,OAAO,GAAG,IAAI;IAIxB;;;;;;OAMG;IACH,aAAa,IAAI,MAAM,GAAG,IAAI;IAI9B;;;;OAIG;IACH,YAAY,IAAI,cAAc,EAAE;IAIhC;;;;OAIG;IACH,QAAQ,IAAI,UAAU,EAAE;IAIxB;;;;;OAKG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAQ9D;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAYzC;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAQb;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAUhD;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,IAAI;IAU9C;;OAEG;YACW,YAAY;IAyC1B;;OAEG;IACH,OAAO,CAAC,SAAS;CASlB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAEvE"}
|
package/dist/mock-server.js
CHANGED
|
@@ -57,6 +57,7 @@ class MockServer {
|
|
|
57
57
|
apiPrefix: options.apiPrefix ?? '/api',
|
|
58
58
|
hotReload: options.hotReload ?? true,
|
|
59
59
|
watcherOptions: options.watcherOptions,
|
|
60
|
+
globalDelay: options.globalDelay,
|
|
60
61
|
};
|
|
61
62
|
// Create config loader
|
|
62
63
|
this.configLoader = new config_loader_js_1.ConfigLoader(this.options.configPath);
|
|
@@ -85,6 +86,8 @@ class MockServer {
|
|
|
85
86
|
port: this.options.port,
|
|
86
87
|
apiPrefix: this.options.apiPrefix,
|
|
87
88
|
hotReload: this.options.hotReload,
|
|
89
|
+
configPath: this.options.configPath,
|
|
90
|
+
globalDelay: this.options.globalDelay,
|
|
88
91
|
};
|
|
89
92
|
this.serverApp = new mock_server_app_js_1.MockServerApp(serverOptions);
|
|
90
93
|
// Set config writer for endpoint/flow management via admin API
|
|
@@ -355,4 +355,138 @@ const mockEndpoints = [
|
|
|
355
355
|
const resolver = (0, response_resolver_js_1.createResponseResolver)(stateManager);
|
|
356
356
|
(0, vitest_1.expect)(resolver).toBeInstanceOf(response_resolver_js_1.ResponseResolver);
|
|
357
357
|
});
|
|
358
|
+
(0, vitest_1.it)('should accept optional configPath', () => {
|
|
359
|
+
const stateManager = new index_js_1.StateManager();
|
|
360
|
+
const resolver = (0, response_resolver_js_1.createResponseResolver)(stateManager, '/some/path');
|
|
361
|
+
(0, vitest_1.expect)(resolver).toBeInstanceOf(response_resolver_js_1.ResponseResolver);
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
(0, vitest_1.describe)('file response', () => {
|
|
365
|
+
let stateManager;
|
|
366
|
+
let resolver;
|
|
367
|
+
const fileEndpoint = {
|
|
368
|
+
id: 'download-report',
|
|
369
|
+
path: '/reports/report.pdf',
|
|
370
|
+
method: 'GET',
|
|
371
|
+
scenarios: [
|
|
372
|
+
{
|
|
373
|
+
id: 'pdf',
|
|
374
|
+
name: 'PDF Report',
|
|
375
|
+
status: 200,
|
|
376
|
+
file: './fixtures/report.pdf',
|
|
377
|
+
},
|
|
378
|
+
],
|
|
379
|
+
defaultScenarioId: 'pdf',
|
|
380
|
+
};
|
|
381
|
+
const jsonEndpoint = {
|
|
382
|
+
id: 'get-data',
|
|
383
|
+
path: '/data',
|
|
384
|
+
method: 'GET',
|
|
385
|
+
scenarios: [{ id: 'success', name: 'Success', status: 200, body: { ok: true } }],
|
|
386
|
+
defaultScenarioId: 'success',
|
|
387
|
+
};
|
|
388
|
+
(0, vitest_1.beforeEach)(() => {
|
|
389
|
+
stateManager = new index_js_1.StateManager();
|
|
390
|
+
stateManager.setEndpoints([fileEndpoint, jsonEndpoint]);
|
|
391
|
+
resolver = (0, response_resolver_js_1.createResponseResolver)(stateManager, '/config/path');
|
|
392
|
+
resolver.setEndpoints([fileEndpoint, jsonEndpoint]);
|
|
393
|
+
});
|
|
394
|
+
(0, vitest_1.it)('should resolve filePath in ResolvedResponse when scenario has file', () => {
|
|
395
|
+
const req = createMockRequest();
|
|
396
|
+
const resolved = resolver.resolveResponse('download-report', req);
|
|
397
|
+
(0, vitest_1.expect)(resolved).not.toBeNull();
|
|
398
|
+
(0, vitest_1.expect)(resolved.filePath).toBe('/config/path/fixtures/report.pdf');
|
|
399
|
+
(0, vitest_1.expect)(resolved.body).toBeUndefined();
|
|
400
|
+
});
|
|
401
|
+
(0, vitest_1.it)('should update filePath when configPath changes via setConfigPath', () => {
|
|
402
|
+
resolver.setConfigPath('/new/config');
|
|
403
|
+
const req = createMockRequest();
|
|
404
|
+
const resolved = resolver.resolveResponse('download-report', req);
|
|
405
|
+
(0, vitest_1.expect)(resolved.filePath).toBe('/new/config/fixtures/report.pdf');
|
|
406
|
+
});
|
|
407
|
+
(0, vitest_1.it)('should not set filePath for JSON scenarios', () => {
|
|
408
|
+
const req = createMockRequest();
|
|
409
|
+
const resolved = resolver.resolveResponse('get-data', req);
|
|
410
|
+
(0, vitest_1.expect)(resolved.filePath).toBeUndefined();
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
(0, vitest_1.describe)('resolveDelay', () => {
|
|
414
|
+
(0, vitest_1.it)('should return scenario delay when defined', () => {
|
|
415
|
+
(0, vitest_1.expect)((0, response_resolver_js_1.resolveDelay)(200)).toBe(200);
|
|
416
|
+
});
|
|
417
|
+
(0, vitest_1.it)('should return scenario delay even when globalDelay is also set', () => {
|
|
418
|
+
(0, vitest_1.expect)((0, response_resolver_js_1.resolveDelay)(50, 500)).toBe(50);
|
|
419
|
+
(0, vitest_1.expect)((0, response_resolver_js_1.resolveDelay)(0, 500)).toBe(0);
|
|
420
|
+
});
|
|
421
|
+
(0, vitest_1.it)('should return 0 when neither scenario delay nor globalDelay is set', () => {
|
|
422
|
+
(0, vitest_1.expect)((0, response_resolver_js_1.resolveDelay)(undefined)).toBe(0);
|
|
423
|
+
(0, vitest_1.expect)((0, response_resolver_js_1.resolveDelay)(undefined, undefined)).toBe(0);
|
|
424
|
+
});
|
|
425
|
+
(0, vitest_1.it)('should return static globalDelay when scenario has no delay', () => {
|
|
426
|
+
(0, vitest_1.expect)((0, response_resolver_js_1.resolveDelay)(undefined, 300)).toBe(300);
|
|
427
|
+
});
|
|
428
|
+
(0, vitest_1.it)('should return a value within [min, max] range when globalDelay is a tuple', () => {
|
|
429
|
+
const results = Array.from({ length: 50 }, () => (0, response_resolver_js_1.resolveDelay)(undefined, [100, 200]));
|
|
430
|
+
for (const r of results) {
|
|
431
|
+
(0, vitest_1.expect)(r).toBeGreaterThanOrEqual(100);
|
|
432
|
+
(0, vitest_1.expect)(r).toBeLessThanOrEqual(200);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
(0, vitest_1.describe)('ResponseResolver globalDelay', () => {
|
|
437
|
+
const endpoint = {
|
|
438
|
+
id: 'ep',
|
|
439
|
+
path: '/ep',
|
|
440
|
+
method: 'GET',
|
|
441
|
+
scenarios: [
|
|
442
|
+
{ id: 'no-delay', name: 'No delay', status: 200, body: 'ok' },
|
|
443
|
+
{ id: 'with-delay', name: 'With delay', status: 200, body: 'ok', delay: 10 },
|
|
444
|
+
],
|
|
445
|
+
defaultScenarioId: 'no-delay',
|
|
446
|
+
};
|
|
447
|
+
(0, vitest_1.it)('should apply static globalDelay when scenario has no delay', () => {
|
|
448
|
+
const sm = new index_js_1.StateManager();
|
|
449
|
+
sm.setEndpoints([endpoint]);
|
|
450
|
+
const resolver = (0, response_resolver_js_1.createResponseResolver)(sm, '', 150);
|
|
451
|
+
resolver.setEndpoints([endpoint]);
|
|
452
|
+
const resolved = resolver.resolveResponse('ep', createMockRequest());
|
|
453
|
+
(0, vitest_1.expect)(resolved.delay).toBe(150);
|
|
454
|
+
});
|
|
455
|
+
(0, vitest_1.it)('should apply a range globalDelay within bounds', () => {
|
|
456
|
+
const sm = new index_js_1.StateManager();
|
|
457
|
+
sm.setEndpoints([endpoint]);
|
|
458
|
+
const resolver = (0, response_resolver_js_1.createResponseResolver)(sm, '', [50, 100]);
|
|
459
|
+
resolver.setEndpoints([endpoint]);
|
|
460
|
+
for (let i = 0; i < 20; i++) {
|
|
461
|
+
const resolved = resolver.resolveResponse('ep', createMockRequest());
|
|
462
|
+
(0, vitest_1.expect)(resolved.delay).toBeGreaterThanOrEqual(50);
|
|
463
|
+
(0, vitest_1.expect)(resolved.delay).toBeLessThanOrEqual(100);
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
(0, vitest_1.it)('should use scenario delay over globalDelay when scenario has delay set', () => {
|
|
467
|
+
const sm = new index_js_1.StateManager();
|
|
468
|
+
sm.setEndpoints([endpoint]);
|
|
469
|
+
sm.activateScenario('ep', 'with-delay');
|
|
470
|
+
const resolver = (0, response_resolver_js_1.createResponseResolver)(sm, '', 999);
|
|
471
|
+
resolver.setEndpoints([endpoint]);
|
|
472
|
+
const resolved = resolver.resolveResponse('ep', createMockRequest());
|
|
473
|
+
(0, vitest_1.expect)(resolved.delay).toBe(10);
|
|
474
|
+
});
|
|
475
|
+
(0, vitest_1.it)('should default to 0 delay when no scenario delay and no globalDelay', () => {
|
|
476
|
+
const sm = new index_js_1.StateManager();
|
|
477
|
+
sm.setEndpoints([endpoint]);
|
|
478
|
+
const resolver = (0, response_resolver_js_1.createResponseResolver)(sm);
|
|
479
|
+
resolver.setEndpoints([endpoint]);
|
|
480
|
+
const resolved = resolver.resolveResponse('ep', createMockRequest());
|
|
481
|
+
(0, vitest_1.expect)(resolved.delay).toBe(0);
|
|
482
|
+
});
|
|
483
|
+
(0, vitest_1.it)('should update globalDelay via setGlobalDelay', () => {
|
|
484
|
+
const sm = new index_js_1.StateManager();
|
|
485
|
+
sm.setEndpoints([endpoint]);
|
|
486
|
+
const resolver = (0, response_resolver_js_1.createResponseResolver)(sm);
|
|
487
|
+
resolver.setEndpoints([endpoint]);
|
|
488
|
+
resolver.setGlobalDelay(250);
|
|
489
|
+
const resolved = resolver.resolveResponse('ep', createMockRequest());
|
|
490
|
+
(0, vitest_1.expect)(resolved.delay).toBe(250);
|
|
491
|
+
});
|
|
358
492
|
});
|
|
@@ -10,7 +10,17 @@ export declare class ResponseResolver {
|
|
|
10
10
|
private stateManager;
|
|
11
11
|
private endpoints;
|
|
12
12
|
private routeMap;
|
|
13
|
-
|
|
13
|
+
private configPath;
|
|
14
|
+
private globalDelay;
|
|
15
|
+
constructor(stateManager: StateManager, configPath?: string, globalDelay?: number | [number, number]);
|
|
16
|
+
/**
|
|
17
|
+
* Update the config path (used when config is reloaded from a new location)
|
|
18
|
+
*/
|
|
19
|
+
setConfigPath(configPath: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* Update the global delay at runtime
|
|
22
|
+
*/
|
|
23
|
+
setGlobalDelay(globalDelay: number | [number, number] | undefined): void;
|
|
14
24
|
/**
|
|
15
25
|
* Register endpoints for routing
|
|
16
26
|
*/
|
|
@@ -66,8 +76,14 @@ export declare class ResponseResolver {
|
|
|
66
76
|
*/
|
|
67
77
|
handleRequest(endpointId: string, req: Request, res: Response): Promise<boolean>;
|
|
68
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Resolve the effective delay for a response.
|
|
81
|
+
* The scenario's own delay (when defined) always wins over the global fallback.
|
|
82
|
+
* A globalDelay tuple [min, max] produces a uniformly distributed random value.
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveDelay(scenarioDelay: number | undefined, globalDelay?: number | [number, number]): number;
|
|
69
85
|
/**
|
|
70
86
|
* Create a new ResponseResolver instance
|
|
71
87
|
*/
|
|
72
|
-
export declare function createResponseResolver(stateManager: StateManager): ResponseResolver;
|
|
88
|
+
export declare function createResponseResolver(stateManager: StateManager, configPath?: string, globalDelay?: number | [number, number]): ResponseResolver;
|
|
73
89
|
//# sourceMappingURL=response-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-resolver.d.ts","sourceRoot":"","sources":["../../src/resolver/response-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"response-resolver.d.ts","sourceRoot":"","sources":["../../src/resolver/response-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAiB,MAAM,YAAY,CAAC;AAGlF;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,QAAQ,CAA0C;IAC1D,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAwC;gBAGzD,YAAY,EAAE,YAAY,EAC1B,UAAU,GAAE,MAAW,EACvB,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAOzC;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIvC;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI;IAIxE;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI;IAY/C;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAKjE;;OAEG;IACH,eAAe,CAAC,UAAU,EAAE,M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