@zimic/interceptor 0.16.0-canary.6 → 0.16.0-canary.8
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/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 +28 -19
- package/dist/http.js +49 -45
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +49 -46
- package/dist/http.mjs.map +1 -1
- package/package.json +3 -3
- package/src/http/index.ts +5 -2
- package/src/http/interceptor/HttpInterceptorClient.ts +5 -1
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"api",
|
|
15
15
|
"static"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.16.0-canary.
|
|
17
|
+
"version": "0.16.0-canary.8",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/zimicjs/zimic.git",
|
|
@@ -97,13 +97,13 @@
|
|
|
97
97
|
"tsup": "^8.4.0",
|
|
98
98
|
"typescript": "^5.8.2",
|
|
99
99
|
"vitest": "^3.0.8",
|
|
100
|
-
"@zimic/lint-staged-config": "0.0.0",
|
|
101
100
|
"@zimic/eslint-config-node": "0.0.0",
|
|
101
|
+
"@zimic/lint-staged-config": "0.0.0",
|
|
102
102
|
"@zimic/tsconfig": "0.0.0",
|
|
103
103
|
"@zimic/utils": "0.0.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"@zimic/http": "^0.
|
|
106
|
+
"@zimic/http": "^0.2.0 || ^0.2.0-canary.0",
|
|
107
107
|
"typescript": ">=4.8.0"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
package/src/http/index.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export { default as InvalidJSONError } from './interceptorWorker/errors/InvalidJSONError';
|
|
2
|
-
export { default as InvalidFormDataError } from './interceptorWorker/errors/InvalidFormDataError';
|
|
3
1
|
export { default as RunningHttpInterceptorError } from './interceptor/errors/RunningHttpInterceptorError';
|
|
4
2
|
export { default as NotRunningHttpInterceptorError } from './interceptor/errors/NotRunningHttpInterceptorError';
|
|
5
3
|
export { default as UnknownHttpInterceptorPlatformError } from './interceptor/errors/UnknownHttpInterceptorPlatformError';
|
|
6
4
|
export { default as UnknownHttpInterceptorTypeError } from './interceptor/errors/UnknownHttpInterceptorTypeError';
|
|
5
|
+
export { default as RequestSavingSafeLimitExceededError } from './interceptor/errors/RequestSavingSafeLimitExceededError';
|
|
6
|
+
|
|
7
|
+
export { default as InvalidFormDataError } from './interceptorWorker/errors/InvalidFormDataError';
|
|
8
|
+
export { default as InvalidJSONError } from './interceptorWorker/errors/InvalidJSONError';
|
|
7
9
|
export { default as UnregisteredBrowserServiceWorkerError } from './interceptorWorker/errors/UnregisteredBrowserServiceWorkerError';
|
|
10
|
+
|
|
8
11
|
export { default as DisabledRequestSavingError } from './requestHandler/errors/DisabledRequestSavingError';
|
|
9
12
|
export { default as TimesCheckError } from './requestHandler/errors/TimesCheckError';
|
|
10
13
|
|
|
@@ -80,7 +80,7 @@ class HttpInterceptorClient<
|
|
|
80
80
|
this.baseURL = options.baseURL;
|
|
81
81
|
|
|
82
82
|
this.requestSaving = {
|
|
83
|
-
enabled: options.requestSaving?.enabled ?? (
|
|
83
|
+
enabled: options.requestSaving?.enabled ?? this.getDefaultRequestSavingEnabled(),
|
|
84
84
|
safeLimit: options.requestSaving?.safeLimit ?? DEFAULT_REQUEST_SAVING_SAFE_LIMIT,
|
|
85
85
|
};
|
|
86
86
|
|
|
@@ -91,6 +91,10 @@ class HttpInterceptorClient<
|
|
|
91
91
|
this.Handler = options.Handler;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
private getDefaultRequestSavingEnabled(): boolean {
|
|
95
|
+
return isServerSide() ? process.env.NODE_ENV === 'test' : false;
|
|
96
|
+
}
|
|
97
|
+
|
|
94
98
|
get baseURL() {
|
|
95
99
|
return this._baseURL;
|
|
96
100
|
}
|