@zimic/interceptor 1.0.0-rc.4 → 1.0.0-rc.6
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/{chunk-CZIDAF2X.mjs → chunk-7DRPXOOJ.mjs} +2 -2
- package/dist/{chunk-CZIDAF2X.mjs.map → chunk-7DRPXOOJ.mjs.map} +1 -1
- package/dist/{chunk-P23SDDCC.js → chunk-LWUFSWRA.js} +2 -2
- package/dist/{chunk-P23SDDCC.js.map → chunk-LWUFSWRA.js.map} +1 -1
- package/dist/cli.js +18 -18
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/http.js +8 -5
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +8 -5
- package/dist/http.mjs.map +1 -1
- package/dist/server.js +6 -6
- package/dist/server.mjs +1 -1
- package/package.json +9 -9
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +4 -1
- package/src/utils/data.ts +10 -7
package/dist/server.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLWUFSWRA_js = require('./chunk-LWUFSWRA.js');
|
|
4
4
|
require('./chunk-WCQVDF3K.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "DEFAULT_ACCESS_CONTROL_HEADERS", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkLWUFSWRA_js.DEFAULT_ACCESS_CONTROL_HEADERS; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "DEFAULT_PREFLIGHT_STATUS_CODE", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkLWUFSWRA_js.DEFAULT_PREFLIGHT_STATUS_CODE; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "NotRunningInterceptorServerError", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkLWUFSWRA_js.NotRunningInterceptorServerError_default; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "RunningInterceptorServerError", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkLWUFSWRA_js.RunningInterceptorServerError_default; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "createInterceptorServer", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkLWUFSWRA_js.createInterceptorServer; }
|
|
27
27
|
});
|
|
28
28
|
//# sourceMappingURL=server.js.map
|
|
29
29
|
//# sourceMappingURL=server.js.map
|
package/dist/server.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DEFAULT_ACCESS_CONTROL_HEADERS, DEFAULT_PREFLIGHT_STATUS_CODE, NotRunningInterceptorServerError_default as NotRunningInterceptorServerError, RunningInterceptorServerError_default as RunningInterceptorServerError, createInterceptorServer } from './chunk-
|
|
1
|
+
export { DEFAULT_ACCESS_CONTROL_HEADERS, DEFAULT_PREFLIGHT_STATUS_CODE, NotRunningInterceptorServerError_default as NotRunningInterceptorServerError, RunningInterceptorServerError_default as RunningInterceptorServerError, createInterceptorServer } from './chunk-7DRPXOOJ.mjs';
|
|
2
2
|
import './chunk-CGILA3WO.mjs';
|
|
3
3
|
//# sourceMappingURL=server.mjs.map
|
|
4
4
|
//# sourceMappingURL=server.mjs.map
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"api",
|
|
15
15
|
"static"
|
|
16
16
|
],
|
|
17
|
-
"version": "1.0.0-rc.
|
|
17
|
+
"version": "1.0.0-rc.6",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/zimicjs/zimic.git",
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
"./package.json": "./package.json"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@whatwg-node/server": "0.10.
|
|
82
|
+
"@whatwg-node/server": "0.10.12",
|
|
83
83
|
"execa": "9.6.0",
|
|
84
84
|
"isomorphic-ws": "5.0.0",
|
|
85
85
|
"msw": "2.10.4",
|
|
86
86
|
"picocolors": "^1.1.1",
|
|
87
87
|
"ws": "8.18.3",
|
|
88
88
|
"yargs": "18.0.0",
|
|
89
|
-
"zod": "^4.0.
|
|
89
|
+
"zod": "^4.0.14"
|
|
90
90
|
},
|
|
91
91
|
"optionalDependencies": {
|
|
92
92
|
"bufferutil": "4.0.9"
|
|
@@ -97,20 +97,20 @@
|
|
|
97
97
|
"@types/yargs": "^17.0.33",
|
|
98
98
|
"@vitest/browser": "^3.2.4",
|
|
99
99
|
"@vitest/coverage-istanbul": "^3.2.4",
|
|
100
|
-
"dotenv-cli": "^
|
|
100
|
+
"dotenv-cli": "^10.0.0",
|
|
101
101
|
"eslint": "^9.32.0",
|
|
102
|
-
"playwright": "^1.54.
|
|
102
|
+
"playwright": "^1.54.2",
|
|
103
103
|
"tsup": "^8.4.0",
|
|
104
|
-
"typescript": "^5.
|
|
104
|
+
"typescript": "^5.9.2",
|
|
105
105
|
"vitest": "^3.2.4",
|
|
106
106
|
"@zimic/eslint-config-node": "0.0.0",
|
|
107
|
-
"@zimic/lint-staged-config": "0.0.0",
|
|
108
107
|
"@zimic/tsconfig": "0.0.0",
|
|
109
|
-
"@zimic/utils": "0.0.0"
|
|
108
|
+
"@zimic/utils": "0.0.0",
|
|
109
|
+
"@zimic/lint-staged-config": "0.0.0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
112
|
"typescript": ">=5.0.0",
|
|
113
|
-
"@zimic/http": "^0.7.0 || ^1.0.0-rc || 1.0.0-rc.
|
|
113
|
+
"@zimic/http": "^0.7.0 || ^1.0.0-rc || 1.0.0-rc.5"
|
|
114
114
|
},
|
|
115
115
|
"peerDependenciesMeta": {
|
|
116
116
|
"typescript": {
|
|
@@ -350,7 +350,10 @@ class HttpRequestHandlerClient<
|
|
|
350
350
|
if (restrictionBody instanceof ArrayBuffer) {
|
|
351
351
|
restrictionBodyAsBlob = convertArrayBufferToBlob(restrictionBody, { type: body.type });
|
|
352
352
|
} else if (restrictionBody instanceof ReadableStream) {
|
|
353
|
-
restrictionBodyAsBlob = await convertReadableStreamToBlob(
|
|
353
|
+
restrictionBodyAsBlob = await convertReadableStreamToBlob(
|
|
354
|
+
restrictionBody as ReadableStream<Uint8Array<ArrayBuffer>>,
|
|
355
|
+
{ type: body.type },
|
|
356
|
+
);
|
|
354
357
|
} else {
|
|
355
358
|
restrictionBodyAsBlob = restrictionBody;
|
|
356
359
|
}
|
package/src/utils/data.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { isClientSide } from './environment';
|
|
2
2
|
|
|
3
|
-
export async function convertReadableStreamToBlob(
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export async function convertReadableStreamToBlob(
|
|
4
|
+
stream: ReadableStream<Uint8Array<ArrayBuffer>>,
|
|
5
|
+
options?: BlobPropertyBag,
|
|
6
|
+
): Promise<Blob> {
|
|
7
|
+
const chunks: Uint8Array<ArrayBuffer>[] = [];
|
|
8
|
+
const reader = stream.getReader();
|
|
6
9
|
|
|
7
10
|
while (true) {
|
|
8
|
-
const
|
|
11
|
+
const result = await reader.read();
|
|
9
12
|
|
|
10
|
-
if (
|
|
11
|
-
chunks.push(
|
|
13
|
+
if (result.value) {
|
|
14
|
+
chunks.push(result.value);
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
if (
|
|
17
|
+
if (result.done) {
|
|
15
18
|
break;
|
|
16
19
|
}
|
|
17
20
|
}
|