@schmock/core 2.4.1 → 2.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 +129 -0
- package/dist/abort.d.ts +11 -1
- package/dist/abort.js +13 -2
- package/dist/adapter.d.ts +21 -0
- package/dist/adapter.js +19 -0
- package/dist/admission.d.ts +21 -0
- package/dist/admission.js +39 -0
- package/dist/binary.d.ts +0 -1
- package/dist/builder.d.ts +16 -32
- package/dist/builder.js +425 -904
- package/dist/constants.d.ts +33 -2
- package/dist/constants.js +73 -1
- package/dist/debug-logger.d.ts +10 -0
- package/dist/debug-logger.js +31 -0
- package/dist/delay.d.ts +12 -0
- package/dist/delay.js +37 -0
- package/dist/errors.d.ts +13 -2
- package/dist/errors.js +21 -2
- package/dist/events.d.ts +17 -0
- package/dist/events.js +58 -0
- package/dist/generations.d.ts +48 -0
- package/dist/generations.js +82 -0
- package/dist/headers.d.ts +27 -0
- package/dist/headers.js +57 -0
- package/dist/helpers.d.ts +9 -10
- package/dist/helpers.js +4 -1
- package/dist/history.d.ts +56 -0
- package/dist/history.js +151 -0
- package/dist/http-helpers.d.ts +110 -5
- package/dist/http-helpers.js +328 -46
- package/dist/index.d.ts +295 -31
- package/dist/index.js +17 -9
- package/dist/interceptor.d.ts +40 -10
- package/dist/interceptor.js +412 -178
- package/dist/node-server.d.ts +27 -0
- package/dist/node-server.js +166 -0
- package/dist/parser.d.ts +0 -1
- package/dist/parser.js +145 -22
- package/dist/plugin-hooks.d.ts +57 -0
- package/dist/plugin-hooks.js +276 -0
- package/dist/plugin-pipeline.d.ts +0 -1
- package/dist/plugin-pipeline.js +25 -4
- package/dist/response-normalizer.d.ts +36 -1
- package/dist/response-normalizer.js +102 -0
- package/dist/response-parser.d.ts +19 -1
- package/dist/response-parser.js +77 -19
- package/dist/route-matcher.d.ts +0 -1
- package/dist/route-table.d.ts +64 -0
- package/dist/route-table.js +220 -0
- package/dist/snapshot.d.ts +14 -0
- package/dist/snapshot.js +98 -0
- package/dist/types.d.ts +34 -1
- package/package.json +8 -3
- package/dist/abort.d.ts.map +0 -1
- package/dist/binary.d.ts.map +0 -1
- package/dist/builder.d.ts.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/helpers.d.ts.map +0 -1
- package/dist/http-helpers.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/interceptor.d.ts.map +0 -1
- package/dist/parser.d.ts.map +0 -1
- package/dist/plugin-pipeline.d.ts.map +0 -1
- package/dist/response-normalizer.d.ts.map +0 -1
- package/dist/response-parser.d.ts.map +0 -1
- package/dist/route-matcher.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { DebugLogger } from "./debug-logger.js";
|
|
2
|
+
import type { CompiledCallableRoute } from "./route-matcher.js";
|
|
3
|
+
/** The route containers an admitted request routes with. */
|
|
4
|
+
export interface RouteTableSnapshot {
|
|
5
|
+
readonly routes: CompiledCallableRoute[];
|
|
6
|
+
readonly staticRoutes: Map<string, CompiledCallableRoute>;
|
|
7
|
+
}
|
|
8
|
+
/** The table as it stood before a `pipe()` install, for its rollback. */
|
|
9
|
+
interface RouteTableCheckpoint extends RouteTableSnapshot {
|
|
10
|
+
readonly shared: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The mock's registered routes: every route in registration order, plus the
|
|
14
|
+
* static (parameterless) ones in a map for O(1) lookup.
|
|
15
|
+
*
|
|
16
|
+
* The containers are copy-on-write. An admitted request captures them by
|
|
17
|
+
* reference (`share()`), and the first registration after that copies them,
|
|
18
|
+
* so an in-flight snapshot never changes underneath its request and no
|
|
19
|
+
* request pays for a copy of the whole table.
|
|
20
|
+
*/
|
|
21
|
+
export declare class RouteTable {
|
|
22
|
+
#private;
|
|
23
|
+
/** O(1) snapshot for an admitted request. */
|
|
24
|
+
share(): RouteTableSnapshot;
|
|
25
|
+
define(input: {
|
|
26
|
+
route: Schmock.RouteKey;
|
|
27
|
+
generator: Schmock.Generator;
|
|
28
|
+
config: Schmock.RouteConfig;
|
|
29
|
+
logger: DebugLogger;
|
|
30
|
+
}): void;
|
|
31
|
+
list(): Schmock.RouteInfo[];
|
|
32
|
+
/**
|
|
33
|
+
* Start a transaction: later registrations go into fresh copies, and
|
|
34
|
+
* `rollback()` puts the table back exactly as it was.
|
|
35
|
+
*/
|
|
36
|
+
checkpoint(): RouteTableCheckpoint;
|
|
37
|
+
rollback(checkpoint: RouteTableCheckpoint): void;
|
|
38
|
+
/**
|
|
39
|
+
* Empty the table. The containers are replaced, never cleared in place:
|
|
40
|
+
* in-flight admissions still route with the old ones.
|
|
41
|
+
*/
|
|
42
|
+
clear(): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A per-request copy of a route's config for the plugin context.
|
|
46
|
+
*
|
|
47
|
+
* Shallow on purpose: plugin metadata under `openapi:*` keys is shared,
|
|
48
|
+
* read-only structure (and some of it is keyed by identity in WeakMaps), but a
|
|
49
|
+
* plugin that assigns `context.route.contentType` or edits the delay tuple must
|
|
50
|
+
* not change every later request.
|
|
51
|
+
*/
|
|
52
|
+
export declare function copyRouteConfig(config: Schmock.RouteConfig): Schmock.RouteConfig;
|
|
53
|
+
/**
|
|
54
|
+
* Deep-copy the plain data (arrays and plain objects) of a static generator so
|
|
55
|
+
* plugins can edit their response in place without changing the route.
|
|
56
|
+
*
|
|
57
|
+
* Anything else — dates, binary values, class instances with a prototype
|
|
58
|
+
* `toJSON` — is passed by reference: `structuredClone` would strip those
|
|
59
|
+
* prototypes (a Buffer would come back as a bare Uint8Array) and change what
|
|
60
|
+
* the response serializes to. Enumerable symbol keys are kept so the response
|
|
61
|
+
* normalizer still sees, and rejects, them.
|
|
62
|
+
*/
|
|
63
|
+
export declare function copyStaticData(value: unknown, copies?: Map<object, unknown>): unknown;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { isBinaryBody } from "./binary.js";
|
|
2
|
+
import { normalizePath } from "./constants.js";
|
|
3
|
+
import { RouteDefinitionError } from "./errors.js";
|
|
4
|
+
import { parseRouteKey } from "./parser.js";
|
|
5
|
+
function defaultContentType(generator) {
|
|
6
|
+
if (typeof generator === "function") {
|
|
7
|
+
// Default to JSON for function generators
|
|
8
|
+
return "application/json";
|
|
9
|
+
}
|
|
10
|
+
if (typeof generator === "string" ||
|
|
11
|
+
typeof generator === "number" ||
|
|
12
|
+
typeof generator === "boolean") {
|
|
13
|
+
// Default to plain text for primitives
|
|
14
|
+
return "text/plain";
|
|
15
|
+
}
|
|
16
|
+
if (isBinaryBody(generator)) {
|
|
17
|
+
// Default to octet-stream for browser and Node binary values
|
|
18
|
+
return "application/octet-stream";
|
|
19
|
+
}
|
|
20
|
+
// Default to JSON for objects/arrays
|
|
21
|
+
return "application/json";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The mock's registered routes: every route in registration order, plus the
|
|
25
|
+
* static (parameterless) ones in a map for O(1) lookup.
|
|
26
|
+
*
|
|
27
|
+
* The containers are copy-on-write. An admitted request captures them by
|
|
28
|
+
* reference (`share()`), and the first registration after that copies them,
|
|
29
|
+
* so an in-flight snapshot never changes underneath its request and no
|
|
30
|
+
* request pays for a copy of the whole table.
|
|
31
|
+
*/
|
|
32
|
+
export class RouteTable {
|
|
33
|
+
#routes = [];
|
|
34
|
+
#staticRoutes = new Map();
|
|
35
|
+
/** True once an admission holds the containers by reference. */
|
|
36
|
+
#shared = false;
|
|
37
|
+
/** O(1) snapshot for an admitted request. */
|
|
38
|
+
share() {
|
|
39
|
+
this.#shared = true;
|
|
40
|
+
return { routes: this.#routes, staticRoutes: this.#staticRoutes };
|
|
41
|
+
}
|
|
42
|
+
define(input) {
|
|
43
|
+
const { route, generator, logger } = input;
|
|
44
|
+
// FIX 1.2: shallow-clone the caller's config so mutations below stay private
|
|
45
|
+
const routeConfig = { ...input.config };
|
|
46
|
+
// Auto-detect contentType if not provided
|
|
47
|
+
if (!routeConfig.contentType) {
|
|
48
|
+
routeConfig.contentType = defaultContentType(generator);
|
|
49
|
+
}
|
|
50
|
+
// Validate generator matches contentType if it's static data
|
|
51
|
+
if (typeof generator !== "function" &&
|
|
52
|
+
routeConfig.contentType === "application/json") {
|
|
53
|
+
try {
|
|
54
|
+
JSON.stringify(generator);
|
|
55
|
+
}
|
|
56
|
+
catch (_error) {
|
|
57
|
+
throw new RouteDefinitionError(route, "Generator data is not valid JSON but contentType is application/json");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Parse the route key to create pattern and extract parameters
|
|
61
|
+
const parsed = parseRouteKey(route);
|
|
62
|
+
// FIX 2.2: normalize paths before duplicate check so /users and /users/ are
|
|
63
|
+
// treated as the same route (consistent with the static-route Map key below).
|
|
64
|
+
// Routes that differ only in parameter names (`/users/:id` and
|
|
65
|
+
// `/users/:userId`) compile to the same pattern and match the same
|
|
66
|
+
// requests, so the later one would be unreachable: it is a duplicate too.
|
|
67
|
+
const normalizedParsedPath = normalizePath(parsed.path);
|
|
68
|
+
const existing = this.#routes.find((r) => r.method === parsed.method &&
|
|
69
|
+
(normalizePath(r.path) === normalizedParsedPath ||
|
|
70
|
+
r.pattern.source === parsed.pattern.source));
|
|
71
|
+
if (existing) {
|
|
72
|
+
logger.log("warning", normalizePath(existing.path) === normalizedParsedPath
|
|
73
|
+
? `Duplicate route: ${route} — first registration wins`
|
|
74
|
+
: `Duplicate route: ${route} matches the same requests as ${existing.method} ${existing.path} — first registration wins`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// Compile the route
|
|
78
|
+
const compiledRoute = {
|
|
79
|
+
pattern: parsed.pattern,
|
|
80
|
+
params: parsed.params,
|
|
81
|
+
method: parsed.method,
|
|
82
|
+
path: parsed.path,
|
|
83
|
+
generator,
|
|
84
|
+
config: routeConfig,
|
|
85
|
+
};
|
|
86
|
+
this.#writable();
|
|
87
|
+
this.#routes.push(compiledRoute);
|
|
88
|
+
// Store static routes (no params) in Map for O(1) lookup
|
|
89
|
+
if (parsed.params.length === 0) {
|
|
90
|
+
const key = `${parsed.method} ${normalizePath(parsed.path)}`;
|
|
91
|
+
this.#staticRoutes.set(key, compiledRoute);
|
|
92
|
+
}
|
|
93
|
+
logger.log("route", `Route defined: ${route}`, {
|
|
94
|
+
contentType: routeConfig.contentType,
|
|
95
|
+
generatorType: typeof generator,
|
|
96
|
+
hasParams: parsed.params.length > 0,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
list() {
|
|
100
|
+
return this.#routes.map((r) => ({
|
|
101
|
+
method: r.method,
|
|
102
|
+
path: r.path,
|
|
103
|
+
hasParams: r.params.length > 0,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Start a transaction: later registrations go into fresh copies, and
|
|
108
|
+
* `rollback()` puts the table back exactly as it was.
|
|
109
|
+
*/
|
|
110
|
+
checkpoint() {
|
|
111
|
+
const checkpoint = {
|
|
112
|
+
routes: this.#routes,
|
|
113
|
+
staticRoutes: this.#staticRoutes,
|
|
114
|
+
shared: this.#shared,
|
|
115
|
+
};
|
|
116
|
+
this.#routes = checkpoint.routes.slice();
|
|
117
|
+
this.#staticRoutes = new Map(checkpoint.staticRoutes);
|
|
118
|
+
this.#shared = false;
|
|
119
|
+
return checkpoint;
|
|
120
|
+
}
|
|
121
|
+
rollback(checkpoint) {
|
|
122
|
+
this.#routes = checkpoint.routes;
|
|
123
|
+
this.#staticRoutes = checkpoint.staticRoutes;
|
|
124
|
+
this.#shared = checkpoint.shared;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Empty the table. The containers are replaced, never cleared in place:
|
|
128
|
+
* in-flight admissions still route with the old ones.
|
|
129
|
+
*/
|
|
130
|
+
clear() {
|
|
131
|
+
this.#routes = [];
|
|
132
|
+
this.#staticRoutes = new Map();
|
|
133
|
+
this.#shared = false;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Copy-on-write for the route tables. An admitted request routes with the
|
|
137
|
+
* containers it captured, by reference; the first registration after that
|
|
138
|
+
* copies them so the in-flight snapshot never changes underneath it.
|
|
139
|
+
*/
|
|
140
|
+
#writable() {
|
|
141
|
+
if (!this.#shared)
|
|
142
|
+
return;
|
|
143
|
+
this.#routes = this.#routes.slice();
|
|
144
|
+
this.#staticRoutes = new Map(this.#staticRoutes);
|
|
145
|
+
this.#shared = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A per-request copy of a route's config for the plugin context.
|
|
150
|
+
*
|
|
151
|
+
* Shallow on purpose: plugin metadata under `openapi:*` keys is shared,
|
|
152
|
+
* read-only structure (and some of it is keyed by identity in WeakMaps), but a
|
|
153
|
+
* plugin that assigns `context.route.contentType` or edits the delay tuple must
|
|
154
|
+
* not change every later request.
|
|
155
|
+
*/
|
|
156
|
+
export function copyRouteConfig(config) {
|
|
157
|
+
const copy = { ...config };
|
|
158
|
+
if (Array.isArray(config.delay)) {
|
|
159
|
+
copy.delay = [config.delay[0], config.delay[1]];
|
|
160
|
+
}
|
|
161
|
+
return copy;
|
|
162
|
+
}
|
|
163
|
+
function isPlainObject(value) {
|
|
164
|
+
const prototype = Object.getPrototypeOf(value);
|
|
165
|
+
return prototype === Object.prototype || prototype === null;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Define an own enumerable data property. Plain assignment would run the
|
|
169
|
+
* `__proto__` setter for an own `__proto__` key (which `JSON.parse` creates),
|
|
170
|
+
* dropping the key and re-prototyping the copy.
|
|
171
|
+
*/
|
|
172
|
+
function defineDataProperty(target, key, value) {
|
|
173
|
+
Object.defineProperty(target, key, {
|
|
174
|
+
value,
|
|
175
|
+
enumerable: true,
|
|
176
|
+
writable: true,
|
|
177
|
+
configurable: true,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Deep-copy the plain data (arrays and plain objects) of a static generator so
|
|
182
|
+
* plugins can edit their response in place without changing the route.
|
|
183
|
+
*
|
|
184
|
+
* Anything else — dates, binary values, class instances with a prototype
|
|
185
|
+
* `toJSON` — is passed by reference: `structuredClone` would strip those
|
|
186
|
+
* prototypes (a Buffer would come back as a bare Uint8Array) and change what
|
|
187
|
+
* the response serializes to. Enumerable symbol keys are kept so the response
|
|
188
|
+
* normalizer still sees, and rejects, them.
|
|
189
|
+
*/
|
|
190
|
+
export function copyStaticData(value, copies = new Map()) {
|
|
191
|
+
if (typeof value !== "object" || value === null)
|
|
192
|
+
return value;
|
|
193
|
+
const existing = copies.get(value);
|
|
194
|
+
if (existing !== undefined)
|
|
195
|
+
return existing;
|
|
196
|
+
if (Array.isArray(value)) {
|
|
197
|
+
const copy = new Array(value.length);
|
|
198
|
+
copies.set(value, copy);
|
|
199
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
200
|
+
if (index in value)
|
|
201
|
+
copy[index] = copyStaticData(value[index], copies);
|
|
202
|
+
}
|
|
203
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
204
|
+
if (!Object.getOwnPropertyDescriptor(value, key)?.enumerable)
|
|
205
|
+
continue;
|
|
206
|
+
defineDataProperty(copy, key, copyStaticData(Reflect.get(value, key), copies));
|
|
207
|
+
}
|
|
208
|
+
return copy;
|
|
209
|
+
}
|
|
210
|
+
if (!isPlainObject(value))
|
|
211
|
+
return value;
|
|
212
|
+
const copy = Object.getPrototypeOf(value) === null ? Object.create(null) : {};
|
|
213
|
+
copies.set(value, copy);
|
|
214
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
215
|
+
if (!Object.getOwnPropertyDescriptor(value, key)?.enumerable)
|
|
216
|
+
continue;
|
|
217
|
+
defineDataProperty(copy, key, copyStaticData(Reflect.get(value, key), copies));
|
|
218
|
+
}
|
|
219
|
+
return copy;
|
|
220
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function snapshotValue(value: unknown): unknown;
|
|
2
|
+
/**
|
|
3
|
+
* Snapshot a body that already went through `normalizeResponse`.
|
|
4
|
+
*
|
|
5
|
+
* A normalized body is a string, a `JSON.parse` tree or a fresh byte copy, so
|
|
6
|
+
* it can never hold shared memory: the `removeSharedMemory` walk that caller
|
|
7
|
+
* supplied values need would only re-visit every node for nothing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function snapshotNormalizedBody(value: unknown): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Snapshot a request body as a transport read it. A `FormData` is copied entry
|
|
12
|
+
* by entry, since `structuredClone` cannot copy one.
|
|
13
|
+
*/
|
|
14
|
+
export declare function snapshotRequestBody(body: unknown): unknown;
|
package/dist/snapshot.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function unavailableValue(value) {
|
|
2
|
+
let type = typeof value;
|
|
3
|
+
if (typeof value === "object" && value !== null) {
|
|
4
|
+
try {
|
|
5
|
+
type = Object.prototype.toString.call(value);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
type = "object";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
kind: "unavailable",
|
|
13
|
+
reason: "not-structured-cloneable",
|
|
14
|
+
type,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function removeSharedMemory(value, seen = new WeakMap()) {
|
|
18
|
+
if (typeof value !== "object" || value === null)
|
|
19
|
+
return value;
|
|
20
|
+
const existing = seen.get(value);
|
|
21
|
+
if (existing !== undefined)
|
|
22
|
+
return existing;
|
|
23
|
+
if (typeof SharedArrayBuffer !== "undefined" &&
|
|
24
|
+
value instanceof SharedArrayBuffer) {
|
|
25
|
+
const copy = Uint8Array.from(new Uint8Array(value)).buffer;
|
|
26
|
+
seen.set(value, copy);
|
|
27
|
+
return copy;
|
|
28
|
+
}
|
|
29
|
+
if (ArrayBuffer.isView(value) &&
|
|
30
|
+
typeof SharedArrayBuffer !== "undefined" &&
|
|
31
|
+
value.buffer instanceof SharedArrayBuffer) {
|
|
32
|
+
const copy = Uint8Array.from(new Uint8Array(value.buffer, value.byteOffset, value.byteLength));
|
|
33
|
+
seen.set(value, copy);
|
|
34
|
+
return copy;
|
|
35
|
+
}
|
|
36
|
+
seen.set(value, value);
|
|
37
|
+
if (value instanceof Map) {
|
|
38
|
+
const entries = [...value.entries()];
|
|
39
|
+
value.clear();
|
|
40
|
+
for (const [key, entryValue] of entries) {
|
|
41
|
+
value.set(removeSharedMemory(key, seen), removeSharedMemory(entryValue, seen));
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
if (value instanceof Set) {
|
|
46
|
+
const entries = [...value.values()];
|
|
47
|
+
value.clear();
|
|
48
|
+
for (const entryValue of entries) {
|
|
49
|
+
value.add(removeSharedMemory(entryValue, seen));
|
|
50
|
+
}
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
54
|
+
Reflect.set(value, key, removeSharedMemory(Reflect.get(value, key), seen));
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
export function snapshotValue(value) {
|
|
59
|
+
try {
|
|
60
|
+
return removeSharedMemory(structuredClone(value));
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return unavailableValue(value);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Snapshot a body that already went through `normalizeResponse`.
|
|
68
|
+
*
|
|
69
|
+
* A normalized body is a string, a `JSON.parse` tree or a fresh byte copy, so
|
|
70
|
+
* it can never hold shared memory: the `removeSharedMemory` walk that caller
|
|
71
|
+
* supplied values need would only re-visit every node for nothing.
|
|
72
|
+
*/
|
|
73
|
+
export function snapshotNormalizedBody(value) {
|
|
74
|
+
try {
|
|
75
|
+
return structuredClone(value);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return unavailableValue(value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Snapshot a request body as a transport read it. A `FormData` is copied entry
|
|
83
|
+
* by entry, since `structuredClone` cannot copy one.
|
|
84
|
+
*/
|
|
85
|
+
export function snapshotRequestBody(body) {
|
|
86
|
+
if (typeof FormData !== "undefined" && body instanceof FormData) {
|
|
87
|
+
try {
|
|
88
|
+
const copy = new FormData();
|
|
89
|
+
for (const [key, value] of body.entries())
|
|
90
|
+
copy.append(key, value);
|
|
91
|
+
return copy;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return unavailableValue(body);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return snapshotValue(body);
|
|
98
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type CallableMockInstance = Schmock.CallableMockInstance;
|
|
|
15
15
|
export type Plugin = Schmock.Plugin;
|
|
16
16
|
export type PluginContext = Schmock.PluginContext;
|
|
17
17
|
export type PluginResult = Schmock.PluginResult;
|
|
18
|
+
export type PluginHookResult = Schmock.PluginHookResult;
|
|
18
19
|
export type StaticData = Schmock.StaticData;
|
|
19
20
|
export type RequestRecord = Schmock.RequestRecord;
|
|
20
21
|
export type ServerInfo = Schmock.ServerInfo;
|
|
@@ -24,9 +25,22 @@ export type ResponseHeaderDef = Schmock.ResponseHeaderDef;
|
|
|
24
25
|
export type CrudOperationMeta = Schmock.CrudOperationMeta;
|
|
25
26
|
export type SchemaGenerationContext = Schmock.SchemaGenerationContext;
|
|
26
27
|
export type FakerPluginOptions = Schmock.FakerPluginOptions;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Import `ExpressAdapterOptions` from `@schmock/express`, which
|
|
30
|
+
* types `req`/`res` as Express's `Request`/`Response`. This copy types them
|
|
31
|
+
* `unknown` and will be removed in the next major version.
|
|
32
|
+
*/
|
|
27
33
|
export type ExpressAdapterOptions = Schmock.ExpressAdapterOptions;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Import `AngularAdapterOptions` from `@schmock/angular`, which
|
|
36
|
+
* types `request` as Angular's `HttpRequest`. This copy types it `unknown` and
|
|
37
|
+
* will be removed in the next major version.
|
|
38
|
+
*/
|
|
28
39
|
export type AngularAdapterOptions = Schmock.AngularAdapterOptions;
|
|
29
40
|
export type OpenApiOptions = Schmock.OpenApiOptions;
|
|
41
|
+
export type OpenApiRefPolicy = Schmock.OpenApiRefPolicy;
|
|
42
|
+
export type OnSchemaContext = Schmock.OnSchemaContext;
|
|
43
|
+
export type OnSchemaCallback = Schmock.OnSchemaCallback;
|
|
30
44
|
export type OpenApiCallbackRequest = Schmock.OpenApiCallbackRequest;
|
|
31
45
|
export type OpenApiCallbackOptions = Schmock.OpenApiCallbackOptions;
|
|
32
46
|
export type SeedSource = Schmock.SeedSource;
|
|
@@ -36,4 +50,23 @@ export type AdapterResponse = Schmock.AdapterResponse;
|
|
|
36
50
|
export type InterceptOptions = Schmock.InterceptOptions;
|
|
37
51
|
export type InterceptHandle = Schmock.InterceptHandle;
|
|
38
52
|
export type AdapterRequestOverride = Schmock.AdapterRequestOverride;
|
|
39
|
-
|
|
53
|
+
export type PaginateOptions = Schmock.PaginateOptions;
|
|
54
|
+
export type PaginatedResponse<T> = Schmock.PaginatedResponse<T>;
|
|
55
|
+
export type RequestStartEvent = Schmock.RequestStartEvent;
|
|
56
|
+
export type RequestMatchEvent = Schmock.RequestMatchEvent;
|
|
57
|
+
export type RequestNotFoundEvent = Schmock.RequestNotFoundEvent;
|
|
58
|
+
export type RequestEndEvent = Schmock.RequestEndEvent;
|
|
59
|
+
export type SchmockEventMap = Schmock.SchmockEventMap;
|
|
60
|
+
export type SchmockEvent = Schmock.SchmockEvent;
|
|
61
|
+
export type ResponseParts = Schmock.ResponseParts;
|
|
62
|
+
export type PathPrefix = Schmock.PathPrefix;
|
|
63
|
+
export type FormattedErrorOptions = Schmock.FormattedErrorOptions;
|
|
64
|
+
export type MockRequestHandler = Schmock.MockRequestHandler;
|
|
65
|
+
export type RequestAdmission = Schmock.RequestAdmission;
|
|
66
|
+
export type FetchRelay = Schmock.FetchRelay;
|
|
67
|
+
export type Exchange = Schmock.Exchange;
|
|
68
|
+
export type ExchangeRequest = Schmock.ExchangeRequest;
|
|
69
|
+
export type ExchangeResponse = Schmock.ExchangeResponse;
|
|
70
|
+
export type AnsweredExchange = Schmock.AnsweredExchange;
|
|
71
|
+
export type FailedExchange = Schmock.FailedExchange;
|
|
72
|
+
export type AbortedExchange = Schmock.AbortedExchange;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schmock/core",
|
|
3
3
|
"description": "Core functionality for Schmock",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
"import": "./dist/index.js",
|
|
28
28
|
"default": "./dist/index.js"
|
|
29
29
|
},
|
|
30
|
+
"./adapter": {
|
|
31
|
+
"types": "./dist/adapter.d.ts",
|
|
32
|
+
"import": "./dist/adapter.js",
|
|
33
|
+
"default": "./dist/adapter.js"
|
|
34
|
+
},
|
|
30
35
|
"./package.json": "./package.json"
|
|
31
36
|
},
|
|
32
37
|
"scripts": {
|
|
@@ -39,8 +44,8 @@
|
|
|
39
44
|
"test:watch": "vitest --watch",
|
|
40
45
|
"pretest:bdd": "rm -f src/*.js src/*.d.ts || true",
|
|
41
46
|
"test:bdd": "vitest run --config vitest.config.bdd.ts",
|
|
42
|
-
"lint": "biome check src
|
|
43
|
-
"lint:fix": "biome check --write --unsafe src
|
|
47
|
+
"lint": "biome check src/",
|
|
48
|
+
"lint:fix": "biome check --write --unsafe src/",
|
|
44
49
|
"check:publish": "publint && attw --pack --ignore-rules cjs-resolves-to-esm"
|
|
45
50
|
},
|
|
46
51
|
"license": "MIT",
|
package/dist/abort.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abort.d.ts","sourceRoot":"","sources":["../src/abort.ts"],"names":[],"mappings":"AASA,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAEzD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EACzB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,CAAC,CAAC,CAmBZ"}
|
package/dist/binary.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,WAAW,GAAG,eAAe,CAExC"}
|
package/dist/builder.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAqBhE,UAAU,gBAAgB;IACxB,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,qBAAqB,EAAE,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,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C;CACrD;AAkDD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,IAAI,CAIN;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,uBAAuB,EAC5B,GAAG,EAAE,wBAAwB,EAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,IAAI,CAgCN"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,OAAO,CACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,GAC5B,OAAO,CAAC,oBAAoB,CAyD9B;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,MAAM,EACN,aAAa,EACb,YAAY,EACZ,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,SAAS,EACT,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interceptor.d.ts","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":"AAkCA,KAAK,uBAAuB,GAAG,CAC7B,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,KACpC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAU/B,UAAU,yBAAyB;IACjC,MAAM,EAAE,uBAAuB,CAAC;IAChC,OAAO,IAAI,IAAI,CAAC;CACjB;AAqYD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,GAAE,OAAO,CAAC,gBAAqB,EACtC,YAAY,CAAC,EAAE,MAAM,yBAAyB,EAC9C,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,CAqKzB"}
|
package/dist/parser.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAmD3D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-pipeline.d.ts","sourceRoot":"","sources":["../src/plugin-pipeline.ts"],"names":[],"mappings":"AAGA,uEAAuE;AACvE,UAAU,cAAc;IACtB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9D;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAmED,kEAAkE;AAClE,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,EAClC,OAAO,EAAE,OAAO,CAAC,aAAa,EAC9B,MAAM,EAAE,cAAc,EACtB,MAAM,0BAAiB,GACtB,OAAO,CAAC,cAAc,CAAC,CAwDzB;AAED,gFAAgF;AAChF,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,EAClC,OAAO,EAAE,OAAO,CAAC,aAAa,EAC9B,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,cAAc,EACtB,MAAM,0BAAiB,GACtB,OAAO,CAAC,cAAc,CAAC,CAmBzB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,EAClC,OAAO,EAAE,OAAO,CAAC,aAAa,EAC9B,eAAe,EAAE,OAAO,EACxB,MAAM,EAAE,cAAc,EACtB,MAAM,0BAAiB,GACtB,OAAO,CAAC,cAAc,CAAC,CAiEzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response-normalizer.d.ts","sourceRoot":"","sources":["../src/response-normalizer.ts"],"names":[],"mappings":"AAwBA,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,EAAE,CAAC,CAAC;AAEnD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAmSD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,QAAQ,CAmClB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GACzB,UAAU,GAAG,SAAS,CAcxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response-parser.d.ts","sourceRoot":"","sources":["../src/response-parser.ts"],"names":[],"mappings":"AAwEA;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,OAAO,CAAC,WAAW,GAC/B,OAAO,CAAC,QAAQ,CAuElB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-matcher.d.ts","sourceRoot":"","sources":["../src/route-matcher.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