diff --git a/apps/zimic-test-client/tests/exports/exports.test.ts b/apps/zimic-test-client/tests/exports/exports.test.ts index 2bbe92f65..241744551 100644 --- a/apps/zimic-test-client/tests/exports/exports.test.ts +++ b/apps/zimic-test-client/tests/exports/exports.test.ts @@ -27,26 +27,14 @@ import { type HttpSchema, type HttpMethod, type HttpStatusCode, - type HttpServiceSchema, - type HttpServiceMethodsSchema, type HttpMethodsSchema, - type HttpServiceMethodSchema, type HttpMethodSchema, - type HttpServiceRequestSchema, type HttpRequestSchema, - type HttpServiceResponseSchemaByStatusCode, type HttpResponseSchemaByStatusCode, - type HttpServiceResponseSchema, type HttpResponseSchema, - type HttpServiceResponseSchemaStatusCode, type HttpResponseSchemaStatusCode, - type HttpServiceSchemaMethod, type HttpSchemaMethod, - type HttpServiceSchemaPath, type HttpSchemaPath, - type LiteralHttpServiceSchemaPath, - type NonLiteralHttpServiceSchemaPath, - type PathParamsSchemaFromPath, type InferPathParams, type MergeHttpResponsesByStatusCode, InvalidFormDataError, @@ -64,7 +52,6 @@ import { type LocalHttpInterceptorOptions, type RemoteHttpInterceptorOptions, type UnhandledRequestStrategy, - type ExtractHttpInterceptorSchema, type InferHttpInterceptorSchema, type HttpInterceptorRequest, type HttpInterceptorResponse, @@ -132,7 +119,6 @@ describe('Exports', () => { expectTypeOf>().not.toBeAny(); expectTypeOf>().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); expectTypeOf>().not.toBeAny(); expectTypeOf>().not.toBeAny(); @@ -146,30 +132,18 @@ describe('Exports', () => { expectTypeOf().not.toBeAny(); expectTypeOf().not.toBeAny(); - expectTypeOf().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf().not.toBeAny(); - expectTypeOf().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf().not.toBeAny(); - expectTypeOf().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf().not.toBeAny(); - expectTypeOf().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf().not.toBeAny(); - expectTypeOf().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf().not.toBeAny(); - expectTypeOf().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); expectTypeOf>().not.toBeAny(); @@ -207,7 +181,6 @@ describe('Exports', () => { expectTypeOf().not.toBeAny(); expectTypeOf().not.toBeAny(); expectTypeOf().not.toBeAny(); - expectTypeOf>().not.toBeAny(); // eslint-disable-line @typescript-eslint/no-deprecated expectTypeOf>().not.toBeAny(); expectTypeOf>().not.toBeAny(); expectTypeOf>().not.toBeAny(); diff --git "a/docs/wiki/api\342\200\220zimic\342\200\220http.md" "b/docs/wiki/api\342\200\220zimic\342\200\220http.md" index 8b285492a..daa496e24 100644 --- "a/docs/wiki/api\342\200\220zimic\342\200\220http.md" +++ "b/docs/wiki/api\342\200\220zimic\342\200\220http.md" @@ -20,11 +20,7 @@ - [`HttpSchemaPath`](#httpschemapath) - [`HttpSchemaPath.Literal`](#httpschemapathliteral) - [`HttpSchemaPath.NonLiteral`](#httpschemapathnonliteral) - - [`HttpServiceSchemaPath`](#httpserviceschemapath) - - [`LiteralHttpServiceSchemaPath`](#literalhttpserviceschemapath) - - [`NonLiteralHttpServiceSchemaPath`](#nonliteralhttpserviceschemapath) - [`InferPathParams`](#inferpathparams) - - [`PathParamsSchemaFromPath`](#pathparamsschemafrompath) - [`MergeHttpResponsesByStatusCode`](#mergehttpresponsesbystatuscode) --- @@ -430,24 +426,6 @@ type NonLiteralGetPath = NonLiteralHttpSchemaPath; // "/users" ``` -### `HttpServiceSchemaPath` - -> [!WARNING] -> -> This type is **deprecated**. Please use [`HttpSchemaPath`](#httpschemapath) instead. - -### `LiteralHttpServiceSchemaPath` - -> [!WARNING] -> -> This type is **deprecated**. Please use [`HttpSchemaPath.Literal`](#httpschemapathliteral) instead. - -### `NonLiteralHttpServiceSchemaPath` - -> [!WARNING] -> -> This type is **deprecated**. Please use [`HttpSchemaPath.NonLiteral`](#httpschemapathnonliteral) instead. - ### `InferPathParams` Infers the path parameters schema from a path string, optionally validating it against an @@ -480,12 +458,6 @@ type PathParams = InferPathParams<'/users/:userId'>; // { userId: string } ``` -### `PathParamsSchemaFromPath` - -> [!WARNING] -> -> This type is **deprecated**. Please use [`InferPathParams`](#inferpathparams) instead. - ### `MergeHttpResponsesByStatusCode` Merges multiple HTTP response schemas by status code into a single schema. When there are duplicate status codes, the diff --git "a/docs/wiki/api\342\200\220zimic\342\200\220interceptor\342\200\220http.md" "b/docs/wiki/api\342\200\220zimic\342\200\220interceptor\342\200\220http.md" index cd27dd6d5..081eb8737 100644 --- "a/docs/wiki/api\342\200\220zimic\342\200\220interceptor\342\200\220http.md" +++ "b/docs/wiki/api\342\200\220zimic\342\200\220interceptor\342\200\220http.md" @@ -19,7 +19,6 @@ - [HTTP `interceptor.clear()`](#http-interceptorclear) - [`HttpInterceptor` utility types](#httpinterceptor-utility-types) - [`InferHttpInterceptorSchema`](#inferhttpinterceptorschema) - - [`ExtractHttpInterceptorSchema`](#extracthttpinterceptorschema) - [`HttpRequestHandler`](#httprequesthandler) - [HTTP `handler.method()`](#http-handlermethod) - [HTTP `handler.path()`](#http-handlerpath) @@ -469,13 +468,6 @@ type Schema = InferHttpInterceptorSchema; // } ``` -#### `ExtractHttpInterceptorSchema` - -> [!WARNING] -> -> This type is **deprecated** and was renamed to [`InferHttpInterceptorSchema`](#inferhttpinterceptorschema) with no -> changes in behavior. Please use [`InferHttpInterceptorSchema`](#inferhttpinterceptorschema) instead. - ## `HttpRequestHandler` HTTP request handlers allow declaring HTTP responses to return for intercepted requests. They also keep track of the diff --git a/packages/zimic/src/http/index.ts b/packages/zimic/src/http/index.ts index 9fe2d8130..f72969f54 100644 --- a/packages/zimic/src/http/index.ts +++ b/packages/zimic/src/http/index.ts @@ -1,16 +1,3 @@ -import { - HttpMethodSchema, - HttpMethodsSchema, - HttpRequestSchema, - HttpResponseSchema, - HttpResponseSchemaByStatusCode, - HttpResponseSchemaStatusCode, - HttpSchema, - HttpSchemaMethod, - HttpSchemaPath, - InferPathParams, -} from './types/schema'; - export { default as InvalidFormDataError } from './errors/InvalidFormDataError'; export { default as HttpFormData } from './formData/HttpFormData'; @@ -45,55 +32,6 @@ export type { StrictFormData, } from './types/requests'; -/** @deprecated Use {@link HttpSchema} instead, which is a drop-in replacement. */ -export type HttpServiceSchema = HttpSchema; - -/** @deprecated Use {@link HttpRequestSchema} instead, which is a drop-in replacement. */ -export type HttpServiceRequestSchema = HttpRequestSchema; - -/** @deprecated Use {@link HttpResponseSchema} instead, which is a drop-in replacement. */ -export type HttpServiceResponseSchema = HttpResponseSchema; - -/** @deprecated Use {@link HttpResponseSchemaByStatusCode} instead, which is a drop-in replacement. */ -export type HttpServiceResponseSchemaByStatusCode = HttpResponseSchemaByStatusCode; - -/** @deprecated Use {@link HttpResponseSchemaStatusCode} instead, which is a drop-in replacement. */ -export type HttpServiceResponseSchemaStatusCode = - HttpResponseSchemaStatusCode; - -/** @deprecated Use {@link HttpMethodSchema} instead, which is a drop-in replacement. */ -export type HttpServiceMethodSchema = HttpMethodSchema; - -/** @deprecated Use {@link HttpMethodsSchema} instead, which is a drop-in replacement. */ -export type HttpServiceMethodsSchema = HttpMethodsSchema; - -/** @deprecated Use {@link HttpSchemaMethod} instead, which is a drop-in replacement. */ -export type HttpServiceSchemaMethod = HttpSchemaMethod; - -/** @deprecated Use {@link HttpSchemaPath.Literal} instead, which is a drop-in replacement. */ -export type LiteralHttpServiceSchemaPath< - Schema extends HttpSchema, - Method extends HttpSchemaMethod = HttpSchemaMethod, -> = HttpSchemaPath.Literal; - -/** @deprecated Use {@link HttpSchemaPath.NonLiteral} instead, which is a drop-in replacement. */ -export type NonLiteralHttpServiceSchemaPath< - Schema extends HttpSchema, - Method extends HttpSchemaMethod = HttpSchemaMethod, -> = HttpSchemaPath.NonLiteral; - -/** @deprecated Use {@link HttpSchemaPath} instead, which is a drop-in replacement. */ -export type HttpServiceSchemaPath< - Schema extends HttpSchema, - Method extends HttpSchemaMethod = HttpSchemaMethod, -> = HttpSchemaPath; - -/** - * @deprecated Use {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http#inferpathparams `InferPathParams` } - * instead, which is a drop-in replacement with additional validation. - */ -export type PathParamsSchemaFromPath = InferPathParams; - export type { HttpSchema, HttpMethod, diff --git a/packages/zimic/src/http/types/schema.ts b/packages/zimic/src/http/types/schema.ts index 161cb8e10..bf2816dd1 100644 --- a/packages/zimic/src/http/types/schema.ts +++ b/packages/zimic/src/http/types/schema.ts @@ -195,13 +195,6 @@ export namespace HttpResponseSchemaByStatusCode { [StatusCode in keyof Schema]: StatusCode extends 204 ? HttpResponseSchema.NoBody : Schema[StatusCode]; }; - /** - * A schema representing the strict structure of HTTP responses by status code. - * - * @deprecated Use {@link HttpResponseSchemaByStatusCode} directly instead. - */ - export type Strict = ConvertToStrict; - /** A schema representing the structure of HTTP responses by status code with no body. */ export type NoBody = { [StatusCode in HttpStatusCode]?: HttpResponseSchema.NoBody; @@ -331,28 +324,6 @@ export type ConvertToStrictHttpSchema = { export type HttpSchema = ConvertToStrictHttpSchema; export namespace HttpSchema { - /** - * Declares an HTTP service schema. - * - * **IMPORTANT**: the input of `HttpSchema.Paths` and all of its internal types, except bodies, must be declared - * inline or as a type aliases (`type`). Types other than bodies cannot be interfaces. - * - * @deprecated Use {@link HttpSchema} directly instead, which is a drop-in replacement. - * @example - * import { type HttpSchema } from 'zimic/http'; - * - * type Schema = HttpSchema<{ - * '/users': { - * GET: { - * response: { - * 200: { body: User[] }; - * }; - * }; - * }; - * }>; - */ - export type Paths = ConvertToStrictHttpSchema; - /** * Declares an HTTP service methods schema. * diff --git a/packages/zimic/src/interceptor/http/index.ts b/packages/zimic/src/interceptor/http/index.ts index 968584da1..d61cf9b7c 100644 --- a/packages/zimic/src/interceptor/http/index.ts +++ b/packages/zimic/src/interceptor/http/index.ts @@ -1,4 +1,3 @@ -import { InferHttpInterceptorSchema } from './interceptor/types/schema'; import HttpInterceptorNamespace from './namespace/HttpInterceptorNamespace'; export { default as NotStartedHttpInterceptorError } from './interceptor/errors/NotStartedHttpInterceptorError'; @@ -39,12 +38,6 @@ export type { UnhandledRequestStrategy, } from './interceptor/types/options'; -/** - * @deprecated Use - * {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐interceptor‐http#inferpathparams `InferHttpInterceptorSchema` } - * instead, which is a drop-in replacement. - */ -export type ExtractHttpInterceptorSchema = InferHttpInterceptorSchema; export type { InferHttpInterceptorSchema } from './interceptor/types/schema'; export type { LocalHttpInterceptor, RemoteHttpInterceptor, HttpInterceptor } from './interceptor/types/public';