@zimic/interceptor 0.14.0-canary.26 → 0.15.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/dist/http.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { HttpMethodSchema, HttpRequest, HttpHeaders, HttpRequestHeadersSchema, InferPathParams, HttpSearchParams, HttpRequestSearchParamsSchema, HttpRequestBodySchema, HttpStatusCode, HttpResponseSchema, HttpHeadersInit, HttpResponse, HttpResponseHeadersSchema, HttpResponseBodySchema, HttpSchema, HttpBody, HttpSchemaMethod, HttpSchemaPath, HttpHeadersSchema, HttpSearchParamsSchema, HttpFormData, HttpResponseSchemaStatusCode, HttpMethod, LiteralHttpSchemaPathFromNonLiteral } from '@zimic/http';
1
+ import { HttpMethodSchema, HttpStatusCode, HttpRequest, HttpHeaders, HttpRequestHeadersSchema, InferPathParams, HttpSearchParams, HttpRequestSearchParamsSchema, HttpRequestBodySchema, HttpResponse, HttpResponseHeadersSchema, HttpResponseBodySchema, HttpResponseSchema, HttpHeadersInit, HttpSchema, HttpBody, HttpSchemaMethod, HttpSchemaPath, HttpHeadersSchema, HttpSearchParamsSchema, HttpFormData, HttpResponseSchemaStatusCode, HttpMethod, LiteralHttpSchemaPathFromNonLiteral } from '@zimic/http';
2
2
 
3
3
  type Default<Type, IfEmpty = never> = [undefined | void] extends [Type] ? IfEmpty : Exclude<Type, undefined | void>;
4
4
  type IfNever<Type, Yes, No = Type> = [Type] extends [never] ? Yes : No;
@@ -73,7 +73,7 @@ interface HttpInterceptorResponse<MethodSchema extends HttpMethodSchema, StatusC
73
73
  * A strict representation of an intercepted HTTP request, along with its response. The body, search params and path
74
74
  * params are already parsed by default.
75
75
  */
76
- interface TrackedHttpInterceptorRequest<Path extends string, MethodSchema extends HttpMethodSchema, StatusCode extends HttpStatusCode = never> extends HttpInterceptorRequest<Path, MethodSchema> {
76
+ interface InterceptedHttpInterceptorRequest<Path extends string, MethodSchema extends HttpMethodSchema, StatusCode extends HttpStatusCode = never> extends HttpInterceptorRequest<Path, MethodSchema> {
77
77
  /** The response that was returned for the intercepted request. */
78
78
  response: StatusCode extends [never] ? never : HttpInterceptorResponse<MethodSchema, StatusCode>;
79
79
  }
@@ -457,7 +457,7 @@ interface LocalHttpRequestHandler<Schema extends HttpSchema, Method extends Http
457
457
  * @throws {DisabledRequestSavingError} If the interceptor was not created with `saveRequests: true`.
458
458
  * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐interceptor‐http#http-handlerrequests `handler.requests()` API reference}
459
459
  */
460
- requests: () => readonly TrackedHttpInterceptorRequest<Path, Default<Schema[Path][Method]>, StatusCode>[];
460
+ requests: () => readonly InterceptedHttpInterceptorRequest<Path, Default<Schema[Path][Method]>, StatusCode>[];
461
461
  }
462
462
  /**
463
463
  * A synced remote HTTP request handler. When a remote handler is synced, it is guaranteed that all of the mocking
@@ -571,7 +571,7 @@ interface SyncedRemoteHttpRequestHandler<Schema extends HttpSchema, Method exten
571
571
  * @throws {DisabledRequestSavingError} If the interceptor was not created with `saveRequests: true`.
572
572
  * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐interceptor‐http#http-handlerrequests `handler.requests()` API reference}
573
573
  */
574
- requests: () => Promise<readonly TrackedHttpInterceptorRequest<Path, Default<Schema[Path][Method]>, StatusCode>[]>;
574
+ requests: () => Promise<readonly InterceptedHttpInterceptorRequest<Path, Default<Schema[Path][Method]>, StatusCode>[]>;
575
575
  }
576
576
  /**
577
577
  * A pending remote HTTP request handler. When a remote handler is pending, it is not guaranteed that all of the mocking
@@ -1284,6 +1284,12 @@ declare class TimesCheckError extends TypeError {
1284
1284
  */
1285
1285
  type InferHttpInterceptorSchema<Interceptor> = Interceptor extends LocalHttpInterceptor<infer Schema> ? Schema : Interceptor extends RemoteHttpInterceptor<infer Schema> ? Schema : never;
1286
1286
 
1287
+ /**
1288
+ * @deprecated This type was renamed to {@link InterceptedHttpInterceptorRequest `InterceptedHttpInterceptorRequest`}.
1289
+ * Please use it instead.
1290
+ */
1291
+ type TrackedHttpInterceptorRequest<Path extends string, MethodSchema extends HttpMethodSchema, StatusCode extends HttpStatusCode = never> = InterceptedHttpInterceptorRequest<Path, MethodSchema, StatusCode>;
1292
+
1287
1293
  /**
1288
1294
  * A namespace of interceptor resources for mocking HTTP requests.
1289
1295
  *
@@ -1291,4 +1297,4 @@ type InferHttpInterceptorSchema<Interceptor> = Interceptor extends LocalHttpInte
1291
1297
  */
1292
1298
  declare const httpInterceptor: Readonly<HttpInterceptorNamespace>;
1293
1299
 
1294
- export { DisabledRequestSavingError, type HttpInterceptor, HttpInterceptorNamespace, HttpInterceptorNamespaceDefault, type HttpInterceptorOptions, type HttpInterceptorPlatform, type HttpInterceptorRequest, type HttpInterceptorResponse, type HttpInterceptorType, type HttpRequestHandler, type HttpRequestHandlerBodyStaticRestriction, type HttpRequestHandlerComputedRestriction, type HttpRequestHandlerHeadersStaticRestriction, type HttpRequestHandlerResponseDeclaration, type HttpRequestHandlerResponseDeclarationFactory, type HttpRequestHandlerRestriction, type HttpRequestHandlerSearchParamsStaticRestriction, type HttpRequestHandlerStaticRestriction, type InferHttpInterceptorSchema, InvalidFormDataError, InvalidJSONError, type LocalHttpInterceptor, type LocalHttpInterceptorOptions, type LocalHttpRequestHandler, NotStartedHttpInterceptorError, type PendingRemoteHttpRequestHandler, type RemoteHttpInterceptor, type RemoteHttpInterceptorOptions, type RemoteHttpRequestHandler, type SyncedRemoteHttpRequestHandler, TimesCheckError, type TrackedHttpInterceptorRequest, type UnhandledHttpInterceptorRequest, UnhandledRequestStrategy, UnknownHttpInterceptorPlatformError, UnknownHttpInterceptorTypeError, UnregisteredBrowserServiceWorkerError, httpInterceptor };
1300
+ export { DisabledRequestSavingError, type HttpInterceptor, HttpInterceptorNamespace, HttpInterceptorNamespaceDefault, type HttpInterceptorOptions, type HttpInterceptorPlatform, type HttpInterceptorRequest, type HttpInterceptorResponse, type HttpInterceptorType, type HttpRequestHandler, type HttpRequestHandlerBodyStaticRestriction, type HttpRequestHandlerComputedRestriction, type HttpRequestHandlerHeadersStaticRestriction, type HttpRequestHandlerResponseDeclaration, type HttpRequestHandlerResponseDeclarationFactory, type HttpRequestHandlerRestriction, type HttpRequestHandlerSearchParamsStaticRestriction, type HttpRequestHandlerStaticRestriction, type InferHttpInterceptorSchema, type InterceptedHttpInterceptorRequest, InvalidFormDataError, InvalidJSONError, type LocalHttpInterceptor, type LocalHttpInterceptorOptions, type LocalHttpRequestHandler, NotStartedHttpInterceptorError, type PendingRemoteHttpRequestHandler, type RemoteHttpInterceptor, type RemoteHttpInterceptorOptions, type RemoteHttpRequestHandler, type SyncedRemoteHttpRequestHandler, TimesCheckError, type TrackedHttpInterceptorRequest, type UnhandledHttpInterceptorRequest, UnhandledRequestStrategy, UnknownHttpInterceptorPlatformError, UnknownHttpInterceptorTypeError, UnregisteredBrowserServiceWorkerError, httpInterceptor };