@zimic/interceptor 0.18.0-canary.0 → 0.18.0-canary.1
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-D6W4BBTC.js → chunk-3GG7AT63.js} +2 -2
- package/dist/{chunk-D6W4BBTC.js.map → chunk-3GG7AT63.js.map} +1 -1
- package/dist/{chunk-5OWHKUTM.mjs → chunk-NYY2KKWB.mjs} +2 -2
- package/dist/{chunk-5OWHKUTM.mjs.map → chunk-NYY2KKWB.mjs.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.d.ts +4 -4
- package/dist/http.js.map +1 -1
- package/dist/http.mjs.map +1 -1
- package/dist/server.js +6 -6
- package/dist/server.mjs +1 -1
- package/package.json +3 -3
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +4 -2
- package/src/http/requestHandler/types/requests.ts +6 -2
- package/src/http/requestHandler/types/restrictions.ts +2 -2
package/dist/server.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3GG7AT63_js = require('./chunk-3GG7AT63.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 chunk3GG7AT63_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 chunk3GG7AT63_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 chunk3GG7AT63_js.NotRunningInterceptorServerError_default; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "RunningInterceptorServerError", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk3GG7AT63_js.RunningInterceptorServerError_default; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "createInterceptorServer", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunk3GG7AT63_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-NYY2KKWB.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": "0.18.0-canary.
|
|
17
|
+
"version": "0.18.0-canary.1",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/zimicjs/zimic.git",
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
"typescript": "^5.8.3",
|
|
101
101
|
"vitest": "^3.1.2",
|
|
102
102
|
"@zimic/eslint-config-node": "0.0.0",
|
|
103
|
-
"@zimic/tsconfig": "0.0.0",
|
|
104
103
|
"@zimic/lint-staged-config": "0.0.0",
|
|
105
|
-
"@zimic/utils": "0.0.0"
|
|
104
|
+
"@zimic/utils": "0.0.0",
|
|
105
|
+
"@zimic/tsconfig": "0.0.0"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"typescript": ">=4.8.0",
|
|
@@ -224,7 +224,8 @@ class HttpRequestHandlerClient<
|
|
|
224
224
|
private matchesRequestHeadersRestrictions(
|
|
225
225
|
request: HttpInterceptorRequest<Path, Default<Schema[Path][Method]>>,
|
|
226
226
|
restriction: HttpRequestHandlerStaticRestriction<Schema, Method, Path>,
|
|
227
|
-
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
228
|
+
): RestrictionMatchResult<RestrictionDiff<HttpHeaders<any>>> {
|
|
228
229
|
if (restriction.headers === undefined) {
|
|
229
230
|
return { value: true };
|
|
230
231
|
}
|
|
@@ -248,7 +249,8 @@ class HttpRequestHandlerClient<
|
|
|
248
249
|
private matchesRequestSearchParamsRestrictions(
|
|
249
250
|
request: HttpInterceptorRequest<Path, Default<Schema[Path][Method]>>,
|
|
250
251
|
restriction: HttpRequestHandlerStaticRestriction<Schema, Method, Path>,
|
|
251
|
-
|
|
252
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
253
|
+
): RestrictionMatchResult<RestrictionDiff<HttpSearchParams<any>>> {
|
|
252
254
|
if (restriction.searchParams === undefined) {
|
|
253
255
|
return { value: true };
|
|
254
256
|
}
|
|
@@ -82,7 +82,7 @@ export interface HttpInterceptorRequest<Path extends string, MethodSchema extend
|
|
|
82
82
|
/** The body of the request. It is already parsed by default. */
|
|
83
83
|
body: HttpRequestBodySchema<MethodSchema>;
|
|
84
84
|
/** The raw request object. */
|
|
85
|
-
raw: HttpRequest<HttpRequestBodySchema<MethodSchema
|
|
85
|
+
raw: HttpRequest<HttpRequestBodySchema<MethodSchema>, Default<HttpRequestHeadersSchema<MethodSchema>>>;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -98,7 +98,11 @@ export interface HttpInterceptorResponse<MethodSchema extends HttpMethodSchema,
|
|
|
98
98
|
/** The body of the response. It is already parsed by default. */
|
|
99
99
|
body: HttpResponseBodySchema<MethodSchema, StatusCode>;
|
|
100
100
|
/** The raw response object. */
|
|
101
|
-
raw: HttpResponse<
|
|
101
|
+
raw: HttpResponse<
|
|
102
|
+
HttpResponseBodySchema<MethodSchema, StatusCode>,
|
|
103
|
+
Default<HttpResponseHeadersSchema<MethodSchema, StatusCode>>,
|
|
104
|
+
StatusCode
|
|
105
|
+
>;
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
export const HTTP_INTERCEPTOR_REQUEST_HIDDEN_PROPERTIES = Object.freeze(
|
|
@@ -138,8 +138,8 @@ export type RestrictionMatchResult<Value> = { value: true; diff?: undefined } |
|
|
|
138
138
|
|
|
139
139
|
export interface RestrictionDiffs {
|
|
140
140
|
computed?: RestrictionDiff<boolean>;
|
|
141
|
-
headers?: RestrictionDiff<HttpHeaders<
|
|
142
|
-
searchParams?: RestrictionDiff<HttpSearchParams<
|
|
141
|
+
headers?: RestrictionDiff<HttpHeaders<any>>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
142
|
+
searchParams?: RestrictionDiff<HttpSearchParams<any>>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
143
143
|
body?: RestrictionDiff<unknown>;
|
|
144
144
|
}
|
|
145
145
|
|