@zimic/interceptor 0.16.1 → 0.17.0-canary.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 +0 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/http.d.ts +7 -4
- package/dist/http.js +1 -1
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +1 -1
- package/dist/http.mjs.map +1 -1
- package/package.json +3 -3
- package/src/http/interceptor/factory.ts +3 -3
- package/src/http/interceptor/types/options.ts +7 -3
- package/src/http/interceptor/types/schema.ts +0 -1
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"api",
|
|
15
15
|
"static"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.17.0-canary.0",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/zimicjs/zimic.git",
|
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"tsup": "^8.4.0",
|
|
99
99
|
"typescript": "^5.8.2",
|
|
100
100
|
"vitest": "^3.0.9",
|
|
101
|
+
"@zimic/lint-staged-config": "0.0.0",
|
|
101
102
|
"@zimic/eslint-config-node": "0.0.0",
|
|
102
|
-
"@zimic/tsconfig": "0.0.0",
|
|
103
103
|
"@zimic/utils": "0.0.0",
|
|
104
|
-
"@zimic/
|
|
104
|
+
"@zimic/tsconfig": "0.0.0"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@zimic/http": "^0.2.0 || ^0.2.0-canary.0",
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
RemoteHttpInterceptor as PublicRemoteHttpInterceptor,
|
|
10
10
|
} from './types/public';
|
|
11
11
|
|
|
12
|
-
function isLocalHttpInterceptorOptions(options: HttpInterceptorOptions) {
|
|
13
|
-
return options.type === 'local';
|
|
12
|
+
function isLocalHttpInterceptorOptions(options: HttpInterceptorOptions): options is LocalHttpInterceptorOptions {
|
|
13
|
+
return options.type === undefined || options.type === 'local';
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function isRemoteHttpInterceptorOptions(options: HttpInterceptorOptions) {
|
|
16
|
+
function isRemoteHttpInterceptorOptions(options: HttpInterceptorOptions): options is RemoteHttpInterceptorOptions {
|
|
17
17
|
return options.type === 'remote';
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -104,8 +104,12 @@ export namespace UnhandledRequestStrategy {
|
|
|
104
104
|
export type UnhandledRequestStrategy = UnhandledRequestStrategy.Local | UnhandledRequestStrategy.Remote;
|
|
105
105
|
|
|
106
106
|
export interface SharedHttpInterceptorOptions {
|
|
107
|
-
/**
|
|
108
|
-
|
|
107
|
+
/**
|
|
108
|
+
* The type of the HTTP interceptor.
|
|
109
|
+
*
|
|
110
|
+
* @default 'local'
|
|
111
|
+
*/
|
|
112
|
+
type?: HttpInterceptorType;
|
|
109
113
|
|
|
110
114
|
/**
|
|
111
115
|
* Represents the URL that should be matched by the interceptor. Any request starting with this base URL will be
|
|
@@ -135,7 +139,7 @@ export interface SharedHttpInterceptorOptions {
|
|
|
135
139
|
* @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐interceptor‐http#creating-a-local-http-interceptor Creating a local HTTP interceptor}
|
|
136
140
|
*/
|
|
137
141
|
export interface LocalHttpInterceptorOptions extends SharedHttpInterceptorOptions {
|
|
138
|
-
type
|
|
142
|
+
type?: 'local';
|
|
139
143
|
|
|
140
144
|
/**
|
|
141
145
|
* The strategy to use for unhandled requests. If a request starts with the base URL of the interceptor, but no
|