@zimic/http 1.1.0-canary.0 → 1.1.0-canary.2
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-YDVKDRU6.js → chunk-25VJGVNO.js} +131 -26
- package/dist/chunk-25VJGVNO.js.map +1 -0
- package/dist/{chunk-3L63PLPA.mjs → chunk-G2FXHODT.mjs} +131 -26
- package/dist/chunk-G2FXHODT.mjs.map +1 -0
- package/dist/cli.js +7 -7
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.ts +13 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/typegen.js +2 -2
- package/dist/typegen.mjs +1 -1
- package/package.json +4 -3
- package/src/typegen/openapi/transform/context.ts +8 -2
- package/src/typegen/openapi/transform/filters.ts +10 -16
- package/src/typegen/openapi/transform/methods.ts +11 -5
- package/src/types/schema.ts +56 -20
- package/dist/chunk-3L63PLPA.mjs.map +0 -1
- package/dist/chunk-YDVKDRU6.js.map +0 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../zimic-utils/dist/chunk-2D3UJWOA.mjs","../../zimic-utils/src/data/blobEquals.ts","../../zimic-utils/src/data/fileEquals.ts","../src/formData/HttpFormData.ts","../src/headers/HttpHeaders.ts","../src/searchParams/HttpSearchParams.ts","../src/types/schema.ts"],"names":["__defProp","__name","pickPrimitiveProperties"],"mappings":";;;;AACA,IAAIA,aAAY,MAAA,CAAO,cAAA;AAKvB,IAAIC,OAAAA,mBAAS,MAAA,CAAA,CAAC,MAAA,EAAQ,KAAA,KAAUD,UAAAA,CAAU,MAAA,EAAQ,MAAA,EAAQ,EAAE,KAAA,EAAO,YAAA,EAAc,IAAA,EAAM,CAAA,EAA1E,QAAA,CAAA;;;ACNb,eAAe,UAAA,CAAW,MAAY,SAAA,EAAiB;AACrD,E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BAAA,GAAQ;;;ACzKR,IAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,CAAC,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,OAAA,EAAS,QAAA,EAAU,MAAA,EAAQ,SAAS,CAAU","file":"index.mjs","sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __name, __toESM };\n//# sourceMappingURL=chunk-2D3UJWOA.mjs.map\n//# sourceMappingURL=chunk-2D3UJWOA.mjs.map","async function blobEquals(blob: Blob, otherBlob: Blob) {\n if (blob.type !== otherBlob.type || blob.size !== otherBlob.size) {\n return false;\n }\n\n const reader = blob.stream().getReader();\n const otherReader = otherBlob.stream().getReader();\n\n let buffer: Uint8Array = new Uint8Array(0);\n let otherBuffer: Uint8Array = new Uint8Array(0);\n\n try {\n while (true) {\n await Promise.all([\n buffer.length === 0 &&\n reader.read().then((result) => {\n if (!result.done) {\n buffer = result.value;\n }\n }),\n\n otherBuffer.length === 0 &&\n otherReader.read().then((result) => {\n if (!result.done) {\n otherBuffer = result.value;\n }\n }),\n ]);\n\n const streamsEndedTogether = buffer.length === 0 && otherBuffer.length === 0;\n\n if (streamsEndedTogether) {\n return true;\n }\n\n const oneStreamEndedBeforeTheOther =\n (buffer.length === 0 && otherBuffer.length > 0) || (buffer.length > 0 && otherBuffer.length === 0);\n\n if (oneStreamEndedBeforeTheOther) {\n return false;\n }\n\n const minimumByteLength = Math.min(buffer.length, otherBuffer.length);\n\n for (let byteIndex = 0; byteIndex < minimumByteLength; byteIndex++) {\n if (buffer[byteIndex] !== otherBuffer[byteIndex]) {\n return false;\n }\n }\n\n buffer = buffer.slice(minimumByteLength);\n otherBuffer = otherBuffer.slice(minimumByteLength);\n }\n } finally {\n reader.releaseLock();\n otherReader.releaseLock();\n }\n}\n\nexport default blobEquals;\n","import blobEquals from './blobEquals';\n\nasync function fileEquals(file: File, otherFile: File) {\n return file.name === otherFile.name && (await blobEquals(file, otherFile));\n}\n\nexport default fileEquals;\n","import fileEquals from '@zimic/utils/data/fileEquals';\nimport { ArrayItemIfArray, ReplaceBy } from '@zimic/utils/types';\n\nimport { HttpFormDataSchema, HttpFormDataSchemaName, HttpFormDataSerialized } from './types';\n\n/** @see {@link https://zimic.dev/docs/http/api/http-form-data `HttpFormData` API reference} */\nclass HttpFormData<LooseSchema extends HttpFormDataSchema.Loose = HttpFormDataSchema.Loose> extends FormData {\n readonly _schema!: HttpFormDataSerialized<LooseSchema>;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataset `formData.set()` API reference} */\n set<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n value: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, Blob>,\n ): void;\n set<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blob: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, string>,\n fileName?: string,\n ): void;\n set<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blobOrValue: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n fileName?: string,\n ): void {\n if (fileName === undefined) {\n super.set(name, blobOrValue as Blob);\n } else {\n super.set(name, blobOrValue as Blob, fileName);\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataappend `formData.append()` API reference} */\n append<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n value: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, Blob>,\n ): void;\n append<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blob: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, string>,\n fileName?: string,\n ): void;\n append<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blobOrValue: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n fileName?: string,\n ): void {\n if (fileName === undefined) {\n super.append(name, blobOrValue as Blob);\n } else {\n super.append(name, blobOrValue as Blob, fileName);\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataget `formData.get()` API reference} */\n get<Name extends HttpFormDataSchemaName.NonArray<this['_schema']>>(\n name: Name,\n ): ReplaceBy<ReplaceBy<ArrayItemIfArray<this['_schema'][Name]>, undefined, null>, Blob, File> {\n return super.get(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatagetall `formData.getAll()` API reference} */\n getAll<Name extends HttpFormDataSchemaName.Array<this['_schema']>>(\n name: Name,\n ): ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][Name]>>, Blob, File>[] {\n return super.getAll(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatahas `formData.has()` API reference} */\n has<Name extends HttpFormDataSchemaName<this['_schema']>>(name: Name): boolean {\n return super.has(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatadelete `formData.delete()` API reference} */\n delete<Name extends HttpFormDataSchemaName<this['_schema']>>(name: Name): void {\n super.delete(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataforEach `formData.forEach()` API reference} */\n forEach<This extends HttpFormData<this['_schema']>>(\n callback: <Key extends HttpFormDataSchemaName<this['_schema']>>(\n value: ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][Key]>>, Blob, File>,\n key: Key,\n formData: HttpFormData<this['_schema']>,\n ) => void,\n thisArg?: This,\n ): void {\n super.forEach(callback as (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatakeys `formData.keys()` API reference} */\n keys(): FormDataIterator<HttpFormDataSchemaName<this['_schema']>> {\n return super.keys() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatavalues `formData.values()` API reference} */\n values(): FormDataIterator<\n ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][HttpFormDataSchemaName<this['_schema']>]>>, Blob, File>\n > {\n return super.values() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataentries `formData.entries()` API reference} */\n entries(): FormDataIterator<\n [\n HttpFormDataSchemaName<this['_schema']>,\n ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][HttpFormDataSchemaName<this['_schema']>]>>, Blob, File>,\n ]\n > {\n return super.entries() as never;\n }\n\n [Symbol.iterator](): FormDataIterator<\n [\n HttpFormDataSchemaName<this['_schema']>,\n ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][HttpFormDataSchemaName<this['_schema']>]>>, Blob, File>,\n ]\n > {\n return super[Symbol.iterator]() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataequals `formData.equals()` API reference} */\n async equals<OtherSchema extends LooseSchema>(otherData: HttpFormData<OtherSchema>): Promise<boolean> {\n if (!(await this.contains(otherData))) {\n return false;\n }\n\n for (const key of this.keys()) {\n const otherHasKey = super.has.call(otherData, key);\n if (!otherHasKey) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatacontains `formData.contains()` API reference} */\n async contains<OtherSchema extends LooseSchema>(otherData: HttpFormData<OtherSchema>): Promise<boolean> {\n for (const [otherKey, otherValue] of otherData.entries()) {\n const values = super.getAll.call(this, otherKey);\n\n const haveSameNumberOfValues = values.length === super.getAll.call(otherData, otherKey).length;\n if (!haveSameNumberOfValues) {\n return false;\n }\n\n let valueExists = false;\n\n for (const value of values) {\n if (\n value === otherValue ||\n (value instanceof Blob && (otherValue as Blob) instanceof Blob && (await fileEquals(value, otherValue)))\n ) {\n valueExists = true;\n break;\n }\n }\n\n if (!valueExists) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatatoobject `formData.toObject()` API reference} */\n toObject() {\n const object = {} as this['_schema'];\n\n type SchemaValue = this['_schema'][HttpFormDataSchemaName<this['_schema']>];\n\n for (const [key, value] of this.entries()) {\n if (key in object) {\n const existingValue = object[key] as SchemaValue[];\n\n if (Array.isArray<SchemaValue>(existingValue)) {\n existingValue.push(value as SchemaValue);\n } else {\n object[key] = [existingValue, value] as SchemaValue;\n }\n } else {\n object[key] = value as SchemaValue;\n }\n }\n\n return object;\n }\n}\n\nexport default HttpFormData;\n","import { Default, ReplaceBy } from '@zimic/utils/types';\n\nimport { HttpHeadersSchema, HttpHeadersInit, HttpHeadersSchemaName, HttpHeadersSerialized } from './types';\n\nfunction pickPrimitiveProperties<LooseSchema extends HttpHeadersSchema.Loose>(schema: LooseSchema) {\n return Object.entries(schema).reduce<Record<string, string>>((accumulated, [key, value]) => {\n if (value !== undefined) {\n accumulated[key] = String(value);\n }\n return accumulated;\n }, {});\n}\n\n/** @see {@link https://zimic.dev/docs/http/api/http-headers `HttpHeaders` API reference} */\nclass HttpHeaders<LooseSchema extends HttpHeadersSchema.Loose = HttpHeadersSchema.Loose> extends Headers {\n readonly _schema!: HttpHeadersSerialized<LooseSchema>;\n\n constructor(init?: HttpHeadersInit<LooseSchema>) {\n if (init instanceof Headers || Array.isArray(init) || !init) {\n super(init);\n } else {\n super(pickPrimitiveProperties(init));\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersset `headers.set()` API reference} */\n set<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name, value: NonNullable<LooseSchema[Name]>): void {\n super.set(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersappend `headers.append()` API reference} */\n append<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name, value: NonNullable<LooseSchema[Name]>): void {\n super.append(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersget `headers.get()` API reference} */\n get<Name extends HttpHeadersSchemaName<this['_schema']>>(\n name: Name,\n ): ReplaceBy<this['_schema'][Name], undefined, null> {\n return super.get(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersgetSetCookie `headers.getSetCookie()` API reference} */\n getSetCookie(): NonNullable<Default<this['_schema']['Set-Cookie'], string>>[] {\n return super.getSetCookie() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headershas `headers.has()` API reference} */\n has<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name): boolean {\n return super.has(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersdelete `headers.delete()` API reference} */\n delete<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name): void {\n super.delete(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersforEach `headers.forEach()` API reference} */\n forEach<This extends HttpHeaders<this['_schema']>>(\n callback: <Key extends HttpHeadersSchemaName<this['_schema']>>(\n value: NonNullable<this['_schema'][Key]> & string,\n key: Key,\n headers: Headers,\n ) => void,\n thisArg?: This,\n ): void {\n super.forEach(callback as (value: string, key: string, parent: Headers) => void, thisArg);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headerskeys `headers.keys()` API reference} */\n keys(): HeadersIterator<HttpHeadersSchemaName<this['_schema']>> {\n return super.keys() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersvalues `headers.values()` API reference} */\n values(): HeadersIterator<NonNullable<this['_schema'][HttpHeadersSchemaName<this['_schema']>]> & string> {\n return super.values() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersentries `headers.entries()` API reference} */\n entries(): HeadersIterator<\n [\n HttpHeadersSchemaName<this['_schema']>,\n NonNullable<this['_schema'][HttpHeadersSchemaName<this['_schema']>]> & string,\n ]\n > {\n return super.entries() as never;\n }\n\n [Symbol.iterator](): HeadersIterator<\n [\n HttpHeadersSchemaName<this['_schema']>,\n NonNullable<this['_schema'][HttpHeadersSchemaName<this['_schema']>]> & string,\n ]\n > {\n return super[Symbol.iterator]() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersequals `headers.equals()` API reference} */\n equals<OtherSchema extends LooseSchema>(otherHeaders: HttpHeaders<OtherSchema>): boolean {\n if (!this.contains(otherHeaders)) {\n return false;\n }\n\n for (const key of this.keys()) {\n const otherHasKey = super.has.call(otherHeaders, key);\n if (!otherHasKey) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headerscontains `headers.contains()` API reference} */\n contains<OtherSchema extends LooseSchema>(otherHeaders: HttpHeaders<OtherSchema>): boolean {\n for (const [key, otherValue] of otherHeaders.entries()) {\n const value = super.get.call(this, key);\n\n if (value === null) {\n return false;\n }\n\n const valueItems = this.splitHeaderValues(value);\n const otherValueItems = this.splitHeaderValues(otherValue);\n\n const haveSameNumberOfValues = valueItems.length === otherValueItems.length;\n if (!haveSameNumberOfValues) {\n return false;\n }\n\n for (const otherValueItem of otherValueItems) {\n if (!valueItems.includes(otherValueItem)) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headerstoobject `headers.toObject()` API reference} */\n toObject(): this['_schema'] {\n const object = {} as this['_schema'];\n\n for (const [key, value] of this.entries()) {\n object[key] = value;\n }\n\n return object;\n }\n\n private splitHeaderValues(value: string) {\n return value\n .split(',')\n .map((item) => item.trim())\n .filter((item) => item.length > 0);\n }\n}\n\nexport default HttpHeaders;\n","import { ReplaceBy, ArrayItemIfArray } from '@zimic/utils/types';\n\nimport {\n HttpSearchParamsSchema,\n HttpSearchParamsInit,\n HttpSearchParamsSchemaName,\n HttpSearchParamsSerialized,\n} from './types';\n\nfunction pickPrimitiveProperties<Schema extends HttpSearchParamsSchema.Loose>(schema: Schema) {\n const schemaWithPrimitiveProperties = Object.entries(schema).reduce<Record<string, string>>(\n (accumulated, [key, value]) => {\n if (value !== undefined && !Array.isArray(value)) {\n accumulated[key] = String(value);\n }\n return accumulated;\n },\n {},\n );\n return schemaWithPrimitiveProperties;\n}\n\n/** @see {@link https://zimic.dev/docs/http/api/http-search-params `HttpSearchParams` API reference} */\nclass HttpSearchParams<\n LooseSchema extends HttpSearchParamsSchema.Loose = HttpSearchParamsSchema.Loose,\n> extends URLSearchParams {\n readonly _schema!: HttpSearchParamsSerialized<LooseSchema>;\n\n constructor(init?: HttpSearchParamsInit<LooseSchema>) {\n if (init instanceof URLSearchParams || Array.isArray(init) || typeof init === 'string' || !init) {\n super(init);\n } else {\n super(pickPrimitiveProperties(init));\n this.populateInitArrayProperties(init);\n }\n }\n\n private populateInitArrayProperties(init: LooseSchema) {\n for (const [key, value] of Object.entries(init)) {\n if (Array.isArray(value)) {\n for (const item of value as unknown[]) {\n super.append(key, String(item));\n }\n }\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsset `searchParams.set()` API reference} */\n set<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): void {\n super.set(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsappend `searchParams.append()` API reference} */\n append<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): void {\n super.append(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsget `searchParams.get()` API reference} */\n get<Name extends HttpSearchParamsSchemaName.NonArray<this['_schema']>>(\n name: Name,\n ): ReplaceBy<ArrayItemIfArray<this['_schema'][Name]>, undefined, null> {\n return super.get(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsgetall `searchParams.getAll()` API reference} */\n getAll<Name extends HttpSearchParamsSchemaName.Array<this['_schema']>>(\n name: Name,\n ): ArrayItemIfArray<NonNullable<this['_schema'][Name]>>[] {\n return super.getAll(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamshas `searchParams.has()` API reference} */\n has<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value?: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): boolean {\n return super.has(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsdelete `searchParams.delete()` API reference} */\n delete<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value?: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): void {\n super.delete(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsforEach `searchParams.forEach()` API reference} */\n forEach<This extends HttpSearchParams<this['_schema']>>(\n callback: <Key extends HttpSearchParamsSchemaName<this['_schema']>>(\n value: ArrayItemIfArray<NonNullable<this['_schema'][Key]>>,\n key: Key,\n searchParams: HttpSearchParams<this['_schema']>,\n ) => void,\n thisArg?: This,\n ): void {\n super.forEach(callback as (value: string, key: string, parent: URLSearchParams) => void, thisArg);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamskeys `searchParams.keys()` API reference} */\n keys(): URLSearchParamsIterator<HttpSearchParamsSchemaName<this['_schema']>> {\n return super.keys() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsvalues `searchParams.values()` API reference} */\n values(): URLSearchParamsIterator<\n ArrayItemIfArray<NonNullable<this['_schema'][HttpSearchParamsSchemaName<this['_schema']>]>>\n > {\n return super.values() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsentries `searchParams.entries()` API reference} */\n entries(): URLSearchParamsIterator<\n [\n HttpSearchParamsSchemaName<this['_schema']>,\n ArrayItemIfArray<NonNullable<this['_schema'][HttpSearchParamsSchemaName<this['_schema']>]>>,\n ]\n > {\n return super.entries() as never;\n }\n\n [Symbol.iterator](): URLSearchParamsIterator<\n [\n HttpSearchParamsSchemaName<this['_schema']>,\n ArrayItemIfArray<NonNullable<this['_schema'][HttpSearchParamsSchemaName<this['_schema']>]>>,\n ]\n > {\n return super[Symbol.iterator]() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsequals `searchParams.equals()` API reference} */\n equals<OtherSchema extends LooseSchema>(otherParams: HttpSearchParams<OtherSchema>): boolean {\n return this.contains(otherParams) && this.size === otherParams.size;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamscontains `searchParams.contains()` API reference} */\n contains<OtherSchema extends LooseSchema>(otherParams: HttpSearchParams<OtherSchema>): boolean {\n for (const [key, otherValue] of otherParams.entries()) {\n const values = super.getAll.call(this, key);\n\n const haveSameNumberOfValues = values.length === super.getAll.call(otherParams, key).length;\n if (!haveSameNumberOfValues) {\n return false;\n }\n\n const valueExists = values.includes(otherValue);\n if (!valueExists) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamstoobject `searchParams.toObject()` API reference} */\n toObject() {\n const object = {} as this['_schema'];\n\n type SchemaValue = this['_schema'][HttpSearchParamsSchemaName<this['_schema']>];\n\n for (const [key, value] of this.entries()) {\n if (key in object) {\n const existingValue = object[key] as SchemaValue[];\n\n if (Array.isArray<SchemaValue>(existingValue)) {\n existingValue.push(value as SchemaValue);\n } else {\n object[key] = [existingValue, value] as SchemaValue;\n }\n } else {\n object[key] = value as SchemaValue;\n }\n }\n\n return object;\n }\n}\n\nexport default HttpSearchParams;\n","import {\n IfAny,\n UnionToIntersection,\n UnionHasMoreThanOneType,\n Prettify,\n NonEmptyArray,\n Branded,\n} from '@zimic/utils/types';\n\nimport { HttpFormDataSchema } from '../formData/types';\nimport { HttpHeadersSchema } from '../headers/types';\nimport { HttpPathParamsSchema } from '../pathParams/types';\nimport { HttpSearchParamsSchema } from '../searchParams/types';\nimport { HttpBody } from './requests';\n\nexport const HTTP_METHODS = Object.freeze(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'] as const);\n/**\n * A type representing the currently supported\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Methods `HTTP methods`}.\n */\nexport type HttpMethod = (typeof HTTP_METHODS)[number];\n\n/**\n * A schema representing the structure of an HTTP request.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpRequestSchema {\n headers?: HttpHeadersSchema.Loose;\n searchParams?: HttpSearchParamsSchema.Loose;\n body?: HttpBody.Loose;\n}\n\n/**\n * A schema representing the structure of an HTTP response.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpResponseSchema {\n headers?: HttpHeadersSchema.Loose;\n body?: HttpBody.Loose;\n}\n\n/**\n * The status codes used in HTTP responses, as defined by\n * {@link https://httpwg.org/specs/rfc9110.html#overview.of.status.codes RFC-9110}.\n *\n * - `HttpStatusCode.Information`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#information_responses `1XX`}\n * - `HttpStatusCode.Success`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#successful_responses `2XX`}\n * - `HttpStatusCode.Redirection`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#redirection_messages `3XX`}\n * - `HttpStatusCode.ClientError`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#client_error_responses `4XX`}\n * - `HttpStatusCode.ServerError`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#server_error_responses `5XX`}\n */\nexport type HttpStatusCode =\n | HttpStatusCode.Information\n | HttpStatusCode.Success\n | HttpStatusCode.Redirection\n | HttpStatusCode.ClientError\n | HttpStatusCode.ServerError;\n\nexport namespace HttpStatusCode {\n /**\n * An HTTP status code in the `1XX` range, representing an informational response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#information_responses `1XX`}\n */\n export type Information =\n | 100 // Continue\n | 101 // Switching Protocols\n | 102 // Processing\n | 103; // Early Hints\n\n /**\n * An HTTP status code in the `2XX` range, representing a successful response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#successful_responses `2XX`}\n */\n export type Success =\n | 200 // OK\n | 201 // Created\n | 202 // Accepted\n | 203 // Non-Authoritative Information\n | 204 // No Content\n | 205 // Reset Content\n | 206 // Partial Content\n | 207 // Multi-Status\n | 208 // Already Reported\n | 226; // IM Used\n\n /**\n * An HTTP status code in the `3XX` range, representing a redirection response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#redirection_messages `3XX`}\n */\n export type Redirection =\n | 300 // Multiple Choices\n | 301 // Moved Permanently\n | 302 // Found\n | 303 // See Other\n | 304 // Not Modified\n | 307 // Temporary Redirect\n | 308; // Permanent Redirect\n\n /**\n * An HTTP status code in the `4XX` range, representing a client error response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#client_error_responses `4XX`}\n */\n export type ClientError =\n | 400 // Bad Request\n | 401 // Unauthorized\n | 402 // Payment Required\n | 403 // Forbidden\n | 404 // Not Found\n | 405 // Method Not Allowed\n | 406 // Not Acceptable\n | 407 // Proxy Authentication Required\n | 408 // Request Timeout\n | 409 // Conflict\n | 410 // Gone\n | 411 // Length Required\n | 412 // Precondition Failed\n | 413 // Content Too Large\n | 414 // URI Too Long\n | 415 // Unsupported Media Type\n | 416 // Range Not Satisfiable\n | 417 // Expectation Failed\n | 418 // I'm a teapot\n | 421 // Misdirected Request\n | 422 // Unprocessable Content\n | 423 // Locked\n | 424 // Failed Dependency\n | 425 // Too Early\n | 426 // Upgrade Required\n | 428 // Precondition Required\n | 429 // Too Many Requests\n | 431 // Request Header Fields Too Large\n | 451; // Unavailable For Legal Reasons\n\n /**\n * An HTTP status code in the `5XX` range, representing a server error response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#server_error_responses `5XX`}\n */\n export type ServerError =\n | 500 // Internal Server Error\n | 501 // Not Implemented\n | 502 // Bad Gateway\n | 503 // Service Unavailable\n | 504 // Gateway Timeout\n | 505 // HTTP Version Not Supported\n | 506 // Variant Also Negotiates\n | 507 // Insufficient Storage\n | 508 // Loop Detected\n | 510 // Not Extended\n | 511; // Network Authentication Required\n}\n\n/**\n * A schema representing the structure of HTTP responses by status code.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport type HttpResponseSchemaByStatusCode = {\n [StatusCode in HttpStatusCode]?: HttpResponseSchema;\n};\n\n/**\n * Extracts the status codes used in a response schema by status code.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport type HttpResponseSchemaStatusCode<ResponseSchemaByStatusCode extends HttpResponseSchemaByStatusCode> =\n keyof ResponseSchemaByStatusCode & HttpStatusCode;\n\n/**\n * A schema representing the structure of an HTTP request and response for a given method.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpMethodSchema {\n request?: HttpRequestSchema;\n response?: HttpResponseSchemaByStatusCode;\n}\n\n/**\n * A schema representing the structure of HTTP request and response by method.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpMethodsSchema {\n GET?: HttpMethodSchema;\n POST?: HttpMethodSchema;\n PUT?: HttpMethodSchema;\n PATCH?: HttpMethodSchema;\n DELETE?: HttpMethodSchema;\n HEAD?: HttpMethodSchema;\n OPTIONS?: HttpMethodSchema;\n}\n\ninterface BaseHttpSchema {\n [path: string]: HttpMethodsSchema;\n}\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference} */\nexport type HttpSchema<Schema extends BaseHttpSchema = BaseHttpSchema> = Branded<Schema, 'HttpSchema'>;\n\nexport namespace HttpSchema {\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemamethods `HttpSchema.Methods` API reference} */\n export type Methods<Schema extends HttpMethodsSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemamethod `HttpSchema.Method` API reference} */\n export type Method<Schema extends HttpMethodSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemarequest `HttpSchema.Request` API reference} */\n export type Request<Schema extends HttpRequestSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaresponsebystatuscode `HttpSchema.ResponseByStatusCode` API reference} */\n export type ResponseByStatusCode<Schema extends HttpResponseSchemaByStatusCode> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaresponse `HttpSchema.Response` API reference} */\n export type Response<Schema extends HttpResponseSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemabody `HttpSchema.Body` API reference} */\n export type Body<Schema extends HttpBody.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaheaders `HttpSchema.Headers` API reference} */\n export type Headers<Schema extends HttpHeadersSchema.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemasearchparams `HttpSchema.SearchParams` API reference} */\n export type SearchParams<Schema extends HttpSearchParamsSchema.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapathparams `HttpSchema.PathParams` API reference} */\n export type PathParams<Schema extends HttpPathParamsSchema.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaformdata `HttpSchema.FormData` API reference} */\n export type FormData<Schema extends HttpFormDataSchema.Loose> = Schema;\n}\n\n/**\n * Extracts the methods from an HTTP service schema.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport type HttpSchemaMethod<Schema extends HttpSchema> = IfAny<\n Schema,\n any, // eslint-disable-line @typescript-eslint/no-explicit-any\n keyof UnionToIntersection<Schema[keyof Schema]> & HttpMethod\n>;\n\nexport type AllowAnyStringInPathParams<Path extends string> = Path extends `${infer Prefix}:${string}/${infer Suffix}`\n ? `${Prefix}${string}/${AllowAnyStringInPathParams<Suffix>}`\n : Path extends `${infer Prefix}:${string}`\n ? `${Prefix}${string}`\n : Path;\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapath `HttpSchemaPath` API reference} */\nexport namespace HttpSchemaPath {\n type LooseLiteral<Schema extends HttpSchema, Method extends HttpMethod = HttpMethod> = {\n [Path in keyof Schema & string]: Method extends keyof Schema[Path] ? Path : never;\n }[keyof Schema & string];\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapathliteral `HttpSchemaPath.Literal` API reference} */\n export type Literal<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema> = HttpSchemaMethod<Schema>,\n > = LooseLiteral<Schema, Method>;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapathnonliteral `HttpSchemaPath.NonLiteral` API reference} */\n export type NonLiteral<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema> = HttpSchemaMethod<Schema>,\n > = AllowAnyStringInPathParams<Literal<Schema, Method>>;\n}\n\nexport type HttpSchemaPath<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema> = HttpSchemaMethod<Schema>,\n> = HttpSchemaPath.Literal<Schema, Method> | HttpSchemaPath.NonLiteral<Schema, Method>;\n\ntype LargestPathPrefix<Path extends string> = Path extends `${infer Prefix}/${infer Suffix}`\n ? `${Prefix}/${Suffix extends `${string}/${string}` ? LargestPathPrefix<Suffix> : ''}`\n : Path;\n\ntype ExcludeNonLiteralPathsSupersededByLiteralPath<Path extends string> =\n Path extends `${LargestPathPrefix<Path>}:${string}` ? never : Path;\n\nexport type PreferMostStaticLiteralPath<Path extends string> =\n UnionHasMoreThanOneType<Path> extends true ? ExcludeNonLiteralPathsSupersededByLiteralPath<Path> : Path;\n\ntype RecursiveInferHttpSchemaPath<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema>,\n NonLiteralPath extends string,\n LiteralPath extends HttpSchemaPath.Literal<Schema, Method>,\n> =\n NonLiteralPath extends AllowAnyStringInPathParams<LiteralPath>\n ? NonLiteralPath extends `${AllowAnyStringInPathParams<LiteralPath>}/${string}`\n ? never\n : LiteralPath\n : never;\n\nexport type LiteralHttpSchemaPathFromNonLiteral<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema>,\n NonLiteralPath extends string,\n LiteralPath extends HttpSchemaPath.Literal<Schema, Method> = HttpSchemaPath.Literal<Schema, Method>,\n> = PreferMostStaticLiteralPath<\n LiteralPath extends LiteralPath ? RecursiveInferHttpSchemaPath<Schema, Method, NonLiteralPath, LiteralPath> : never\n>;\n\ntype RecursiveInferPathParams<Path extends string> = Path extends `${infer _Prefix}:${infer ParamName}/${infer Suffix}`\n ? { [Name in ParamName]: string } & RecursiveInferPathParams<Suffix>\n : Path extends `${infer _Prefix}:${infer ParamName}`\n ? { [Name in ParamName]: string }\n : {};\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema#inferpathparams `InferPathParams` API reference} */\nexport type InferPathParams<\n PathOrSchema extends string | HttpSchema,\n OptionalPath extends PathOrSchema extends HttpSchema ? HttpSchemaPath.Literal<PathOrSchema> : never = never,\n> = Prettify<\n RecursiveInferPathParams<\n PathOrSchema extends HttpSchema ? OptionalPath : PathOrSchema extends string ? PathOrSchema : never\n >\n>;\n\ntype OmitPastHttpStatusCodes<\n Schema extends HttpResponseSchemaByStatusCode,\n PastSchemas extends HttpResponseSchemaByStatusCode[],\n> =\n PastSchemas extends NonEmptyArray<HttpResponseSchemaByStatusCode>\n ? Omit<Schema, keyof UnionToIntersection<PastSchemas[number]>>\n : Schema;\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema#mergehttpresponsesbystatuscode `MergeHttpResponsesByStatusCode` API reference} */\nexport type MergeHttpResponsesByStatusCode<\n Schemas extends HttpResponseSchemaByStatusCode[],\n PastSchemas extends HttpResponseSchemaByStatusCode[] = [],\n> = Schemas extends [\n infer FirstSchema extends HttpResponseSchemaByStatusCode,\n ...infer RestSchemas extends HttpResponseSchemaByStatusCode[],\n]\n ? RestSchemas extends NonEmptyArray<HttpResponseSchemaByStatusCode>\n ? OmitPastHttpStatusCodes<FirstSchema, PastSchemas> &\n MergeHttpResponsesByStatusCode<RestSchemas, [...PastSchemas, FirstSchema]>\n : OmitPastHttpStatusCodes<FirstSchema, PastSchemas>\n : never;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../zimic-utils/dist/chunk-2D3UJWOA.mjs","../../zimic-utils/src/data/blobEquals.ts","../../zimic-utils/src/data/fileEquals.ts","../src/formData/HttpFormData.ts","../src/headers/HttpHeaders.ts","../src/searchParams/HttpSearchParams.ts","../src/types/schema.ts"],"names":["__defProp","__name","pickPrimitiveProperties"],"mappings":";;;;AACA,IAAIA,aAAY,MAAA,CAAO,cAAA;AAKvB,IAAIC,OAAAA,mBAAS,MAAA,CAAA,CAAC,MAAA,EAAQ,KAAA,KAAUD,UAAAA,CAAU,MAAA,EAAQ,MAAA,EAAQ,EAAE,KAAA,EAAO,YAAA,EAAc,IAAA,EAAM,CAAA,EAA1E,QAAA,CAAA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AGF,IAAA,OAAO,MAAA;AAAA;AAEX,CAAA;AAEA,IAAO,wBAAA,GAAQ;;;ACzKR,IAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,CAAC,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,OAAA,EAAS,QAAA,EAAU,MAAA,EAAQ,SAAS,CAAU","file":"index.mjs","sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __name, __toESM };\n//# sourceMappingURL=chunk-2D3UJWOA.mjs.map\n//# sourceMappingURL=chunk-2D3UJWOA.mjs.map","async function blobEquals(blob: Blob, otherBlob: Blob) {\n if (blob.type !== otherBlob.type || blob.size !== otherBlob.size) {\n return false;\n }\n\n const reader = blob.stream().getReader();\n const otherReader = otherBlob.stream().getReader();\n\n let buffer: Uint8Array = new Uint8Array(0);\n let otherBuffer: Uint8Array = new Uint8Array(0);\n\n try {\n while (true) {\n await Promise.all([\n buffer.length === 0 &&\n reader.read().then((result) => {\n if (!result.done) {\n buffer = result.value;\n }\n }),\n\n otherBuffer.length === 0 &&\n otherReader.read().then((result) => {\n if (!result.done) {\n otherBuffer = result.value;\n }\n }),\n ]);\n\n const streamsEndedTogether = buffer.length === 0 && otherBuffer.length === 0;\n\n if (streamsEndedTogether) {\n return true;\n }\n\n const oneStreamEndedBeforeTheOther =\n (buffer.length === 0 && otherBuffer.length > 0) || (buffer.length > 0 && otherBuffer.length === 0);\n\n if (oneStreamEndedBeforeTheOther) {\n return false;\n }\n\n const minimumByteLength = Math.min(buffer.length, otherBuffer.length);\n\n for (let byteIndex = 0; byteIndex < minimumByteLength; byteIndex++) {\n if (buffer[byteIndex] !== otherBuffer[byteIndex]) {\n return false;\n }\n }\n\n buffer = buffer.slice(minimumByteLength);\n otherBuffer = otherBuffer.slice(minimumByteLength);\n }\n } finally {\n reader.releaseLock();\n otherReader.releaseLock();\n }\n}\n\nexport default blobEquals;\n","import blobEquals from './blobEquals';\n\nasync function fileEquals(file: File, otherFile: File) {\n return file.name === otherFile.name && (await blobEquals(file, otherFile));\n}\n\nexport default fileEquals;\n","import fileEquals from '@zimic/utils/data/fileEquals';\nimport { ArrayItemIfArray, ReplaceBy } from '@zimic/utils/types';\n\nimport { HttpFormDataSchema, HttpFormDataSchemaName, HttpFormDataSerialized } from './types';\n\n/** @see {@link https://zimic.dev/docs/http/api/http-form-data `HttpFormData` API reference} */\nclass HttpFormData<LooseSchema extends HttpFormDataSchema.Loose = HttpFormDataSchema.Loose> extends FormData {\n readonly _schema!: HttpFormDataSerialized<LooseSchema>;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataset `formData.set()` API reference} */\n set<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n value: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, Blob>,\n ): void;\n set<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blob: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, string>,\n fileName?: string,\n ): void;\n set<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blobOrValue: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n fileName?: string,\n ): void {\n if (fileName === undefined) {\n super.set(name, blobOrValue as Blob);\n } else {\n super.set(name, blobOrValue as Blob, fileName);\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataappend `formData.append()` API reference} */\n append<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n value: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, Blob>,\n ): void;\n append<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blob: Exclude<ArrayItemIfArray<NonNullable<LooseSchema[Name]>>, string>,\n fileName?: string,\n ): void;\n append<Name extends HttpFormDataSchemaName<this['_schema']>>(\n name: Name,\n blobOrValue: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n fileName?: string,\n ): void {\n if (fileName === undefined) {\n super.append(name, blobOrValue as Blob);\n } else {\n super.append(name, blobOrValue as Blob, fileName);\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataget `formData.get()` API reference} */\n get<Name extends HttpFormDataSchemaName.NonArray<this['_schema']>>(\n name: Name,\n ): ReplaceBy<ReplaceBy<ArrayItemIfArray<this['_schema'][Name]>, undefined, null>, Blob, File> {\n return super.get(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatagetall `formData.getAll()` API reference} */\n getAll<Name extends HttpFormDataSchemaName.Array<this['_schema']>>(\n name: Name,\n ): ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][Name]>>, Blob, File>[] {\n return super.getAll(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatahas `formData.has()` API reference} */\n has<Name extends HttpFormDataSchemaName<this['_schema']>>(name: Name): boolean {\n return super.has(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatadelete `formData.delete()` API reference} */\n delete<Name extends HttpFormDataSchemaName<this['_schema']>>(name: Name): void {\n super.delete(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataforEach `formData.forEach()` API reference} */\n forEach<This extends HttpFormData<this['_schema']>>(\n callback: <Key extends HttpFormDataSchemaName<this['_schema']>>(\n value: ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][Key]>>, Blob, File>,\n key: Key,\n formData: HttpFormData<this['_schema']>,\n ) => void,\n thisArg?: This,\n ): void {\n super.forEach(callback as (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatakeys `formData.keys()` API reference} */\n keys(): FormDataIterator<HttpFormDataSchemaName<this['_schema']>> {\n return super.keys() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatavalues `formData.values()` API reference} */\n values(): FormDataIterator<\n ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][HttpFormDataSchemaName<this['_schema']>]>>, Blob, File>\n > {\n return super.values() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataentries `formData.entries()` API reference} */\n entries(): FormDataIterator<\n [\n HttpFormDataSchemaName<this['_schema']>,\n ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][HttpFormDataSchemaName<this['_schema']>]>>, Blob, File>,\n ]\n > {\n return super.entries() as never;\n }\n\n [Symbol.iterator](): FormDataIterator<\n [\n HttpFormDataSchemaName<this['_schema']>,\n ReplaceBy<ArrayItemIfArray<NonNullable<this['_schema'][HttpFormDataSchemaName<this['_schema']>]>>, Blob, File>,\n ]\n > {\n return super[Symbol.iterator]() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdataequals `formData.equals()` API reference} */\n async equals<OtherSchema extends LooseSchema>(otherData: HttpFormData<OtherSchema>): Promise<boolean> {\n if (!(await this.contains(otherData))) {\n return false;\n }\n\n for (const key of this.keys()) {\n const otherHasKey = super.has.call(otherData, key);\n if (!otherHasKey) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatacontains `formData.contains()` API reference} */\n async contains<OtherSchema extends LooseSchema>(otherData: HttpFormData<OtherSchema>): Promise<boolean> {\n for (const [otherKey, otherValue] of otherData.entries()) {\n const values = super.getAll.call(this, otherKey);\n\n const haveSameNumberOfValues = values.length === super.getAll.call(otherData, otherKey).length;\n if (!haveSameNumberOfValues) {\n return false;\n }\n\n let valueExists = false;\n\n for (const value of values) {\n if (\n value === otherValue ||\n (value instanceof Blob && (otherValue as Blob) instanceof Blob && (await fileEquals(value, otherValue)))\n ) {\n valueExists = true;\n break;\n }\n }\n\n if (!valueExists) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-form-data#formdatatoobject `formData.toObject()` API reference} */\n toObject() {\n const object = {} as this['_schema'];\n\n type SchemaValue = this['_schema'][HttpFormDataSchemaName<this['_schema']>];\n\n for (const [key, value] of this.entries()) {\n if (key in object) {\n const existingValue = object[key] as SchemaValue[];\n\n if (Array.isArray<SchemaValue>(existingValue)) {\n existingValue.push(value as SchemaValue);\n } else {\n object[key] = [existingValue, value] as SchemaValue;\n }\n } else {\n object[key] = value as SchemaValue;\n }\n }\n\n return object;\n }\n}\n\nexport default HttpFormData;\n","import { Default, ReplaceBy } from '@zimic/utils/types';\n\nimport { HttpHeadersSchema, HttpHeadersInit, HttpHeadersSchemaName, HttpHeadersSerialized } from './types';\n\nfunction pickPrimitiveProperties<LooseSchema extends HttpHeadersSchema.Loose>(schema: LooseSchema) {\n return Object.entries(schema).reduce<Record<string, string>>((accumulated, [key, value]) => {\n if (value !== undefined) {\n accumulated[key] = String(value);\n }\n return accumulated;\n }, {});\n}\n\n/** @see {@link https://zimic.dev/docs/http/api/http-headers `HttpHeaders` API reference} */\nclass HttpHeaders<LooseSchema extends HttpHeadersSchema.Loose = HttpHeadersSchema.Loose> extends Headers {\n readonly _schema!: HttpHeadersSerialized<LooseSchema>;\n\n constructor(init?: HttpHeadersInit<LooseSchema>) {\n if (init instanceof Headers || Array.isArray(init) || !init) {\n super(init);\n } else {\n super(pickPrimitiveProperties(init));\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersset `headers.set()` API reference} */\n set<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name, value: NonNullable<LooseSchema[Name]>): void {\n super.set(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersappend `headers.append()` API reference} */\n append<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name, value: NonNullable<LooseSchema[Name]>): void {\n super.append(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersget `headers.get()` API reference} */\n get<Name extends HttpHeadersSchemaName<this['_schema']>>(\n name: Name,\n ): ReplaceBy<this['_schema'][Name], undefined, null> {\n return super.get(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersgetSetCookie `headers.getSetCookie()` API reference} */\n getSetCookie(): NonNullable<Default<this['_schema']['Set-Cookie'], string>>[] {\n return super.getSetCookie() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headershas `headers.has()` API reference} */\n has<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name): boolean {\n return super.has(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersdelete `headers.delete()` API reference} */\n delete<Name extends HttpHeadersSchemaName<this['_schema']>>(name: Name): void {\n super.delete(name);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersforEach `headers.forEach()` API reference} */\n forEach<This extends HttpHeaders<this['_schema']>>(\n callback: <Key extends HttpHeadersSchemaName<this['_schema']>>(\n value: NonNullable<this['_schema'][Key]> & string,\n key: Key,\n headers: Headers,\n ) => void,\n thisArg?: This,\n ): void {\n super.forEach(callback as (value: string, key: string, parent: Headers) => void, thisArg);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headerskeys `headers.keys()` API reference} */\n keys(): HeadersIterator<HttpHeadersSchemaName<this['_schema']>> {\n return super.keys() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersvalues `headers.values()` API reference} */\n values(): HeadersIterator<NonNullable<this['_schema'][HttpHeadersSchemaName<this['_schema']>]> & string> {\n return super.values() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersentries `headers.entries()` API reference} */\n entries(): HeadersIterator<\n [\n HttpHeadersSchemaName<this['_schema']>,\n NonNullable<this['_schema'][HttpHeadersSchemaName<this['_schema']>]> & string,\n ]\n > {\n return super.entries() as never;\n }\n\n [Symbol.iterator](): HeadersIterator<\n [\n HttpHeadersSchemaName<this['_schema']>,\n NonNullable<this['_schema'][HttpHeadersSchemaName<this['_schema']>]> & string,\n ]\n > {\n return super[Symbol.iterator]() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headersequals `headers.equals()` API reference} */\n equals<OtherSchema extends LooseSchema>(otherHeaders: HttpHeaders<OtherSchema>): boolean {\n if (!this.contains(otherHeaders)) {\n return false;\n }\n\n for (const key of this.keys()) {\n const otherHasKey = super.has.call(otherHeaders, key);\n if (!otherHasKey) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headerscontains `headers.contains()` API reference} */\n contains<OtherSchema extends LooseSchema>(otherHeaders: HttpHeaders<OtherSchema>): boolean {\n for (const [key, otherValue] of otherHeaders.entries()) {\n const value = super.get.call(this, key);\n\n if (value === null) {\n return false;\n }\n\n const valueItems = this.splitHeaderValues(value);\n const otherValueItems = this.splitHeaderValues(otherValue);\n\n const haveSameNumberOfValues = valueItems.length === otherValueItems.length;\n if (!haveSameNumberOfValues) {\n return false;\n }\n\n for (const otherValueItem of otherValueItems) {\n if (!valueItems.includes(otherValueItem)) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-headers#headerstoobject `headers.toObject()` API reference} */\n toObject(): this['_schema'] {\n const object = {} as this['_schema'];\n\n for (const [key, value] of this.entries()) {\n object[key] = value;\n }\n\n return object;\n }\n\n private splitHeaderValues(value: string) {\n return value\n .split(',')\n .map((item) => item.trim())\n .filter((item) => item.length > 0);\n }\n}\n\nexport default HttpHeaders;\n","import { ReplaceBy, ArrayItemIfArray } from '@zimic/utils/types';\n\nimport {\n HttpSearchParamsSchema,\n HttpSearchParamsInit,\n HttpSearchParamsSchemaName,\n HttpSearchParamsSerialized,\n} from './types';\n\nfunction pickPrimitiveProperties<Schema extends HttpSearchParamsSchema.Loose>(schema: Schema) {\n const schemaWithPrimitiveProperties = Object.entries(schema).reduce<Record<string, string>>(\n (accumulated, [key, value]) => {\n if (value !== undefined && !Array.isArray(value)) {\n accumulated[key] = String(value);\n }\n return accumulated;\n },\n {},\n );\n return schemaWithPrimitiveProperties;\n}\n\n/** @see {@link https://zimic.dev/docs/http/api/http-search-params `HttpSearchParams` API reference} */\nclass HttpSearchParams<\n LooseSchema extends HttpSearchParamsSchema.Loose = HttpSearchParamsSchema.Loose,\n> extends URLSearchParams {\n readonly _schema!: HttpSearchParamsSerialized<LooseSchema>;\n\n constructor(init?: HttpSearchParamsInit<LooseSchema>) {\n if (init instanceof URLSearchParams || Array.isArray(init) || typeof init === 'string' || !init) {\n super(init);\n } else {\n super(pickPrimitiveProperties(init));\n this.populateInitArrayProperties(init);\n }\n }\n\n private populateInitArrayProperties(init: LooseSchema) {\n for (const [key, value] of Object.entries(init)) {\n if (Array.isArray(value)) {\n for (const item of value as unknown[]) {\n super.append(key, String(item));\n }\n }\n }\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsset `searchParams.set()` API reference} */\n set<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): void {\n super.set(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsappend `searchParams.append()` API reference} */\n append<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): void {\n super.append(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsget `searchParams.get()` API reference} */\n get<Name extends HttpSearchParamsSchemaName.NonArray<this['_schema']>>(\n name: Name,\n ): ReplaceBy<ArrayItemIfArray<this['_schema'][Name]>, undefined, null> {\n return super.get(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsgetall `searchParams.getAll()` API reference} */\n getAll<Name extends HttpSearchParamsSchemaName.Array<this['_schema']>>(\n name: Name,\n ): ArrayItemIfArray<NonNullable<this['_schema'][Name]>>[] {\n return super.getAll(name) as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamshas `searchParams.has()` API reference} */\n has<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value?: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): boolean {\n return super.has(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsdelete `searchParams.delete()` API reference} */\n delete<Name extends HttpSearchParamsSchemaName<this['_schema']>>(\n name: Name,\n value?: ArrayItemIfArray<NonNullable<LooseSchema[Name]>>,\n ): void {\n super.delete(name, value);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsforEach `searchParams.forEach()` API reference} */\n forEach<This extends HttpSearchParams<this['_schema']>>(\n callback: <Key extends HttpSearchParamsSchemaName<this['_schema']>>(\n value: ArrayItemIfArray<NonNullable<this['_schema'][Key]>>,\n key: Key,\n searchParams: HttpSearchParams<this['_schema']>,\n ) => void,\n thisArg?: This,\n ): void {\n super.forEach(callback as (value: string, key: string, parent: URLSearchParams) => void, thisArg);\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamskeys `searchParams.keys()` API reference} */\n keys(): URLSearchParamsIterator<HttpSearchParamsSchemaName<this['_schema']>> {\n return super.keys() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsvalues `searchParams.values()` API reference} */\n values(): URLSearchParamsIterator<\n ArrayItemIfArray<NonNullable<this['_schema'][HttpSearchParamsSchemaName<this['_schema']>]>>\n > {\n return super.values() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsentries `searchParams.entries()` API reference} */\n entries(): URLSearchParamsIterator<\n [\n HttpSearchParamsSchemaName<this['_schema']>,\n ArrayItemIfArray<NonNullable<this['_schema'][HttpSearchParamsSchemaName<this['_schema']>]>>,\n ]\n > {\n return super.entries() as never;\n }\n\n [Symbol.iterator](): URLSearchParamsIterator<\n [\n HttpSearchParamsSchemaName<this['_schema']>,\n ArrayItemIfArray<NonNullable<this['_schema'][HttpSearchParamsSchemaName<this['_schema']>]>>,\n ]\n > {\n return super[Symbol.iterator]() as never;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamsequals `searchParams.equals()` API reference} */\n equals<OtherSchema extends LooseSchema>(otherParams: HttpSearchParams<OtherSchema>): boolean {\n return this.contains(otherParams) && this.size === otherParams.size;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamscontains `searchParams.contains()` API reference} */\n contains<OtherSchema extends LooseSchema>(otherParams: HttpSearchParams<OtherSchema>): boolean {\n for (const [key, otherValue] of otherParams.entries()) {\n const values = super.getAll.call(this, key);\n\n const haveSameNumberOfValues = values.length === super.getAll.call(otherParams, key).length;\n if (!haveSameNumberOfValues) {\n return false;\n }\n\n const valueExists = values.includes(otherValue);\n if (!valueExists) {\n return false;\n }\n }\n\n return true;\n }\n\n /** @see {@link https://zimic.dev/docs/http/api/http-search-params#searchparamstoobject `searchParams.toObject()` API reference} */\n toObject() {\n const object = {} as this['_schema'];\n\n type SchemaValue = this['_schema'][HttpSearchParamsSchemaName<this['_schema']>];\n\n for (const [key, value] of this.entries()) {\n if (key in object) {\n const existingValue = object[key] as SchemaValue[];\n\n if (Array.isArray<SchemaValue>(existingValue)) {\n existingValue.push(value as SchemaValue);\n } else {\n object[key] = [existingValue, value] as SchemaValue;\n }\n } else {\n object[key] = value as SchemaValue;\n }\n }\n\n return object;\n }\n}\n\nexport default HttpSearchParams;\n","import {\n IfAny,\n UnionToIntersection,\n UnionHasMoreThanOneType,\n Prettify,\n NonEmptyArray,\n Branded,\n} from '@zimic/utils/types';\n\nimport { HttpFormDataSchema } from '../formData/types';\nimport { HttpHeadersSchema } from '../headers/types';\nimport { HttpPathParamsSchema } from '../pathParams/types';\nimport { HttpSearchParamsSchema } from '../searchParams/types';\nimport { HttpBody } from './requests';\n\nexport const HTTP_METHODS = Object.freeze(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'] as const);\n/**\n * A type representing the currently supported\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Methods `HTTP methods`}.\n */\nexport type HttpMethod = (typeof HTTP_METHODS)[number];\n\n/**\n * A schema representing the structure of an HTTP request.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpRequestSchema {\n headers?: HttpHeadersSchema.Loose;\n searchParams?: HttpSearchParamsSchema.Loose;\n body?: HttpBody.Loose;\n}\n\n/**\n * A schema representing the structure of an HTTP response.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpResponseSchema {\n headers?: HttpHeadersSchema.Loose;\n body?: HttpBody.Loose;\n}\n\n/**\n * The status codes used in HTTP responses, as defined by\n * {@link https://httpwg.org/specs/rfc9110.html#overview.of.status.codes RFC-9110}.\n *\n * - `HttpStatusCode.Information`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#information_responses `1XX`}\n * - `HttpStatusCode.Success`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#successful_responses `2XX`}\n * - `HttpStatusCode.Redirection`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#redirection_messages `3XX`}\n * - `HttpStatusCode.ClientError`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#client_error_responses `4XX`}\n * - `HttpStatusCode.ServerError`: {@link https://developer.mozilla.org/docs/Web/HTTP/Status#server_error_responses `5XX`}\n */\nexport type HttpStatusCode =\n | HttpStatusCode.Information\n | HttpStatusCode.Success\n | HttpStatusCode.Redirection\n | HttpStatusCode.ClientError\n | HttpStatusCode.ServerError;\n\nexport namespace HttpStatusCode {\n /**\n * An HTTP status code in the `1XX` range, representing an informational response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#information_responses `1XX`}\n */\n export type Information =\n | 100 // Continue\n | 101 // Switching Protocols\n | 102 // Processing\n | 103; // Early Hints\n\n /**\n * An HTTP status code in the `2XX` range, representing a successful response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#successful_responses `2XX`}\n */\n export type Success =\n | 200 // OK\n | 201 // Created\n | 202 // Accepted\n | 203 // Non-Authoritative Information\n | 204 // No Content\n | 205 // Reset Content\n | 206 // Partial Content\n | 207 // Multi-Status\n | 208 // Already Reported\n | 226; // IM Used\n\n /**\n * An HTTP status code in the `3XX` range, representing a redirection response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#redirection_messages `3XX`}\n */\n export type Redirection =\n | 300 // Multiple Choices\n | 301 // Moved Permanently\n | 302 // Found\n | 303 // See Other\n | 304 // Not Modified\n | 307 // Temporary Redirect\n | 308; // Permanent Redirect\n\n /**\n * An HTTP status code in the `4XX` range, representing a client error response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#client_error_responses `4XX`}\n */\n export type ClientError =\n | 400 // Bad Request\n | 401 // Unauthorized\n | 402 // Payment Required\n | 403 // Forbidden\n | 404 // Not Found\n | 405 // Method Not Allowed\n | 406 // Not Acceptable\n | 407 // Proxy Authentication Required\n | 408 // Request Timeout\n | 409 // Conflict\n | 410 // Gone\n | 411 // Length Required\n | 412 // Precondition Failed\n | 413 // Content Too Large\n | 414 // URI Too Long\n | 415 // Unsupported Media Type\n | 416 // Range Not Satisfiable\n | 417 // Expectation Failed\n | 418 // I'm a teapot\n | 421 // Misdirected Request\n | 422 // Unprocessable Content\n | 423 // Locked\n | 424 // Failed Dependency\n | 425 // Too Early\n | 426 // Upgrade Required\n | 428 // Precondition Required\n | 429 // Too Many Requests\n | 431 // Request Header Fields Too Large\n | 451; // Unavailable For Legal Reasons\n\n /**\n * An HTTP status code in the `5XX` range, representing a server error response.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Status#server_error_responses `5XX`}\n */\n export type ServerError =\n | 500 // Internal Server Error\n | 501 // Not Implemented\n | 502 // Bad Gateway\n | 503 // Service Unavailable\n | 504 // Gateway Timeout\n | 505 // HTTP Version Not Supported\n | 506 // Variant Also Negotiates\n | 507 // Insufficient Storage\n | 508 // Loop Detected\n | 510 // Not Extended\n | 511; // Network Authentication Required\n}\n\n/**\n * A schema representing the structure of HTTP responses by status code.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport type HttpResponseSchemaByStatusCode = {\n [StatusCode in HttpStatusCode]?: HttpResponseSchema;\n};\n\n/**\n * Extracts the status codes used in a response schema by status code.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport type HttpResponseSchemaStatusCode<ResponseSchemaByStatusCode extends HttpResponseSchemaByStatusCode> =\n keyof ResponseSchemaByStatusCode & HttpStatusCode;\n\n/**\n * A schema representing the structure of an HTTP request and response for a given method.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpMethodSchema {\n request?: HttpRequestSchema;\n response?: HttpResponseSchemaByStatusCode;\n}\n\n/**\n * A schema representing the structure of HTTP request and response by method.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport interface HttpMethodsSchema {\n GET?: HttpMethodSchema;\n POST?: HttpMethodSchema;\n PUT?: HttpMethodSchema;\n PATCH?: HttpMethodSchema;\n DELETE?: HttpMethodSchema;\n HEAD?: HttpMethodSchema;\n OPTIONS?: HttpMethodSchema;\n}\n\ninterface BaseHttpSchema {\n [path: string]: HttpMethodsSchema;\n}\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference} */\nexport type HttpSchema<Schema extends BaseHttpSchema = BaseHttpSchema> = Branded<Schema, 'HttpSchema'>;\n\nexport namespace HttpSchema {\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemamethods `HttpSchema.Methods` API reference} */\n export type Methods<Schema extends HttpMethodsSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemamethod `HttpSchema.Method` API reference} */\n export type Method<Schema extends HttpMethodSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemarequest `HttpSchema.Request` API reference} */\n export type Request<Schema extends HttpRequestSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaresponsebystatuscode `HttpSchema.ResponseByStatusCode` API reference} */\n export type ResponseByStatusCode<Schema extends HttpResponseSchemaByStatusCode> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaresponse `HttpSchema.Response` API reference} */\n export type Response<Schema extends HttpResponseSchema> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemabody `HttpSchema.Body` API reference} */\n export type Body<Schema extends HttpBody.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaheaders `HttpSchema.Headers` API reference} */\n export type Headers<Schema extends HttpHeadersSchema.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemasearchparams `HttpSchema.SearchParams` API reference} */\n export type SearchParams<Schema extends HttpSearchParamsSchema.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapathparams `HttpSchema.PathParams` API reference} */\n export type PathParams<Schema extends HttpPathParamsSchema.Loose> = Schema;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemaformdata `HttpSchema.FormData` API reference} */\n export type FormData<Schema extends HttpFormDataSchema.Loose> = Schema;\n}\n\n/**\n * Extracts the methods from an HTTP service schema.\n *\n * @see {@link https://zimic.dev/docs/http/api/http-schema `HttpSchema` API reference}\n */\nexport type HttpSchemaMethod<Schema extends HttpSchema> = IfAny<\n Schema,\n any, // eslint-disable-line @typescript-eslint/no-explicit-any\n keyof UnionToIntersection<Schema[keyof Schema]> & HttpMethod\n>;\n\ntype RepeatingPathParamModifier = '+';\ntype OptionalPathParamModifier = '?' | '*';\n\ntype ConvertPathParamToRecord<PathParam extends string> = PathParam extends `${infer PathParamWithoutSlash}/`\n ? ConvertPathParamToRecord<PathParamWithoutSlash>\n : PathParam extends `${infer PathParamWithoutModifier}${OptionalPathParamModifier}`\n ? { [Name in PathParamWithoutModifier]?: string }\n : PathParam extends `${infer PathParamWithoutModifier}${RepeatingPathParamModifier}`\n ? { [Name in PathParamWithoutModifier]: string }\n : { [Name in PathParam]: string };\n\ntype RecursiveInferPathParams<Path extends string> = Path extends `${infer Prefix}:${infer PathParamWithRemainingPath}`\n ? PathParamWithRemainingPath extends `${infer PathParam}/${infer RemainingPath}`\n ? Prefix extends `${string}\\\\`\n ? RecursiveInferPathParams<RemainingPath>\n : ConvertPathParamToRecord<PathParam> & RecursiveInferPathParams<RemainingPath>\n : PathParamWithRemainingPath extends `${infer PathParam}\\\\:${infer RemainingPath}`\n ? Prefix extends `${string}\\\\`\n ? RecursiveInferPathParams<`\\\\:${RemainingPath}`>\n : ConvertPathParamToRecord<PathParam> & RecursiveInferPathParams<`\\\\:${RemainingPath}`>\n : PathParamWithRemainingPath extends `${infer PathParam}:${infer RemainingPath}`\n ? Prefix extends `${string}\\\\`\n ? RecursiveInferPathParams<RemainingPath>\n : ConvertPathParamToRecord<PathParam> & RecursiveInferPathParams<`:${RemainingPath}`>\n : Prefix extends `${string}\\\\`\n ? {}\n : ConvertPathParamToRecord<PathParamWithRemainingPath>\n : {};\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema#inferpathparams `InferPathParams` API reference} */\nexport type InferPathParams<\n PathOrSchema extends string | HttpSchema,\n OptionalPath extends PathOrSchema extends HttpSchema ? HttpSchemaPath.Literal<PathOrSchema> : never = never,\n> = Prettify<\n RecursiveInferPathParams<\n PathOrSchema extends HttpSchema ? OptionalPath : PathOrSchema extends string ? PathOrSchema : never\n >\n>;\n\nexport type AllowAnyStringInPathParams<Path extends string> =\n Path extends `${infer Prefix}:${infer PathParamWithRemainingPath}`\n ? PathParamWithRemainingPath extends `${infer PathParam}/${infer RemainingPath}`\n ? Prefix extends `${string}\\\\`\n ? `${Prefix}:${PathParam}/${AllowAnyStringInPathParams<RemainingPath>}`\n : `${Prefix}${string}/${AllowAnyStringInPathParams<RemainingPath>}`\n : PathParamWithRemainingPath extends `${infer PathParam}\\\\:${infer RemainingPath}`\n ? Prefix extends `${string}\\\\`\n ? `${Prefix}:${PathParam}\\\\:${AllowAnyStringInPathParams<`\\\\:${RemainingPath}`>}`\n : `${Prefix}${string}\\\\:${AllowAnyStringInPathParams<`\\\\:${RemainingPath}`>}`\n : PathParamWithRemainingPath extends `${infer PathParam}:${infer RemainingPath}`\n ? Prefix extends `${string}\\\\`\n ? `${Prefix}:${PathParam}:${AllowAnyStringInPathParams<`:${RemainingPath}`>}`\n : `${Prefix}${string}:${AllowAnyStringInPathParams<`:${RemainingPath}`>}`\n : Prefix extends `${string}\\\\`\n ? `${Prefix}:${PathParamWithRemainingPath}`\n : `${Prefix}${string}`\n : Path;\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapath `HttpSchemaPath` API reference} */\nexport namespace HttpSchemaPath {\n type LooseLiteral<Schema extends HttpSchema, Method extends HttpMethod = HttpMethod> = {\n [Path in keyof Schema & string]: Method extends keyof Schema[Path] ? Path : never;\n }[keyof Schema & string];\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapathliteral `HttpSchemaPath.Literal` API reference} */\n export type Literal<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema> = HttpSchemaMethod<Schema>,\n > = LooseLiteral<Schema, Method>;\n\n /** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapathnonliteral `HttpSchemaPath.NonLiteral` API reference} */\n export type NonLiteral<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema> = HttpSchemaMethod<Schema>,\n > = AllowAnyStringInPathParams<Literal<Schema, Method>>;\n}\n\nexport type HttpSchemaPath<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema> = HttpSchemaMethod<Schema>,\n> = HttpSchemaPath.Literal<Schema, Method> | HttpSchemaPath.NonLiteral<Schema, Method>;\n\ntype LargestPathPrefix<Path extends string> = Path extends `${infer Prefix}/${infer Suffix}`\n ? `${Prefix}/${Suffix extends `${string}/${string}` ? LargestPathPrefix<Suffix> : ''}`\n : Path;\n\ntype ExcludeNonLiteralPathsSupersededByLiteralPath<Path extends string> =\n Path extends `${LargestPathPrefix<Path>}:${string}` ? never : Path;\n\nexport type PreferMostStaticLiteralPath<Path extends string> =\n UnionHasMoreThanOneType<Path> extends true ? ExcludeNonLiteralPathsSupersededByLiteralPath<Path> : Path;\n\ntype RecursiveInferHttpSchemaPath<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema>,\n NonLiteralPath extends string,\n LiteralPath extends HttpSchemaPath.Literal<Schema, Method>,\n> =\n NonLiteralPath extends AllowAnyStringInPathParams<LiteralPath>\n ? NonLiteralPath extends `${AllowAnyStringInPathParams<LiteralPath>}/${string}`\n ? never\n : LiteralPath\n : never;\n\nexport type LiteralHttpSchemaPathFromNonLiteral<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema>,\n NonLiteralPath extends string,\n LiteralPath extends HttpSchemaPath.Literal<Schema, Method> = HttpSchemaPath.Literal<Schema, Method>,\n> = PreferMostStaticLiteralPath<\n LiteralPath extends LiteralPath ? RecursiveInferHttpSchemaPath<Schema, Method, NonLiteralPath, LiteralPath> : never\n>;\n\ntype OmitPastHttpStatusCodes<\n Schema extends HttpResponseSchemaByStatusCode,\n PastSchemas extends HttpResponseSchemaByStatusCode[],\n> =\n PastSchemas extends NonEmptyArray<HttpResponseSchemaByStatusCode>\n ? Omit<Schema, keyof UnionToIntersection<PastSchemas[number]>>\n : Schema;\n\n/** @see {@link https://zimic.dev/docs/http/api/http-schema#mergehttpresponsesbystatuscode `MergeHttpResponsesByStatusCode` API reference} */\nexport type MergeHttpResponsesByStatusCode<\n Schemas extends HttpResponseSchemaByStatusCode[],\n PastSchemas extends HttpResponseSchemaByStatusCode[] = [],\n> = Schemas extends [\n infer FirstSchema extends HttpResponseSchemaByStatusCode,\n ...infer RestSchemas extends HttpResponseSchemaByStatusCode[],\n]\n ? RestSchemas extends NonEmptyArray<HttpResponseSchemaByStatusCode>\n ? OmitPastHttpStatusCodes<FirstSchema, PastSchemas> &\n MergeHttpResponsesByStatusCode<RestSchemas, [...PastSchemas, FirstSchema]>\n : OmitPastHttpStatusCodes<FirstSchema, PastSchemas>\n : never;\n"]}
|
package/dist/typegen.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk25VJGVNO_js = require('./chunk-25VJGVNO.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "generateTypesFromOpenAPI", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk25VJGVNO_js.generate_default; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=typegen.js.map
|
|
12
12
|
//# sourceMappingURL=typegen.js.map
|
package/dist/typegen.mjs
CHANGED
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"api",
|
|
13
13
|
"static"
|
|
14
14
|
],
|
|
15
|
-
"version": "1.1.0-canary.
|
|
15
|
+
"version": "1.1.0-canary.2",
|
|
16
|
+
"homepage": "https://zimic.dev/docs/http",
|
|
16
17
|
"repository": {
|
|
17
18
|
"type": "git",
|
|
18
19
|
"url": "https://github.com/zimicjs/zimic.git",
|
|
@@ -91,9 +92,9 @@
|
|
|
91
92
|
"typescript": "^5.9.2",
|
|
92
93
|
"vitest": "^3.2.4",
|
|
93
94
|
"@zimic/eslint-config-node": "0.0.0",
|
|
94
|
-
"@zimic/interceptor": "1.0.
|
|
95
|
-
"@zimic/lint-staged-config": "0.0.0",
|
|
95
|
+
"@zimic/interceptor": "1.1.0-canary.1",
|
|
96
96
|
"@zimic/tsconfig": "0.0.0",
|
|
97
|
+
"@zimic/lint-staged-config": "0.0.0",
|
|
97
98
|
"@zimic/utils": "0.0.0"
|
|
98
99
|
},
|
|
99
100
|
"peerDependencies": {
|
|
@@ -2,9 +2,15 @@ import { convertToPascalCase } from '@/utils/strings';
|
|
|
2
2
|
|
|
3
3
|
import { parseRawFilter, groupParsedFiltersByMatch } from './filters';
|
|
4
4
|
|
|
5
|
+
export interface TypePathFilter {
|
|
6
|
+
methodPattern: RegExp;
|
|
7
|
+
pathPattern: RegExp;
|
|
8
|
+
isNegativeMatch: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
export interface TypePathFilters {
|
|
6
|
-
positive:
|
|
7
|
-
negative:
|
|
12
|
+
positive: TypePathFilter[];
|
|
13
|
+
negative: TypePathFilter[];
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
type HttpTypeImportName =
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import isNonEmpty from '@zimic/utils/data/isNonEmpty';
|
|
2
|
-
import
|
|
2
|
+
import createWildcardPathPattern from '@zimic/utils/url/createWildcardPathPattern';
|
|
3
3
|
import filesystem from 'fs/promises';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import color from 'picocolors';
|
|
@@ -7,7 +7,7 @@ import color from 'picocolors';
|
|
|
7
7
|
import { HTTP_METHODS } from '@/types/schema';
|
|
8
8
|
import { logger } from '@/utils/logging';
|
|
9
9
|
|
|
10
|
-
import { TypePathFilters } from './context';
|
|
10
|
+
import { TypePathFilter, TypePathFilters } from './context';
|
|
11
11
|
|
|
12
12
|
const HTTP_METHOD_OPTIONS = HTTP_METHODS.join('|');
|
|
13
13
|
const MODIFIER_GROUP = '(?<modifier>!?)';
|
|
@@ -15,38 +15,32 @@ const METHOD_FILTER_GROUP = `(?<method>(?:\\*|(?:${HTTP_METHOD_OPTIONS})(?:,\\s*
|
|
|
15
15
|
const PATH_FILTER_GROUP = '(?<path>.+)';
|
|
16
16
|
const FILTER_REGEX = new RegExp(`^${MODIFIER_GROUP}\\s*${METHOD_FILTER_GROUP}\\s+${PATH_FILTER_GROUP}$`, 'i');
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
expression: RegExp;
|
|
20
|
-
isNegativeMatch: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function parseRawFilter(rawFilter: string): ParsedTypePathFilter | undefined {
|
|
18
|
+
export function parseRawFilter(rawFilter: string): TypePathFilter | undefined {
|
|
24
19
|
const filterMatch = rawFilter.match(FILTER_REGEX);
|
|
25
20
|
const { modifier: filterModifier, method: filteredMethodsOrWildcard, path: filteredPath } = filterMatch?.groups ?? {};
|
|
26
21
|
|
|
27
22
|
const isValidFilter = !filteredMethodsOrWildcard || !filteredPath;
|
|
23
|
+
|
|
28
24
|
if (isValidFilter) {
|
|
29
25
|
logger.warn(`Warning: Filter could not be parsed and was ignored: ${color.yellow(rawFilter)}`);
|
|
30
26
|
return undefined;
|
|
31
27
|
}
|
|
32
28
|
|
|
33
|
-
const methodFilterGroup = `(?:${filteredMethodsOrWildcard.toUpperCase().replace(/,/g, '|').replace(/\*/g, '.*')}) `;
|
|
34
|
-
const isNegativeMatch = filterModifier === '!';
|
|
35
|
-
|
|
36
29
|
return {
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
methodPattern: new RegExp(`(?:${filteredMethodsOrWildcard.toUpperCase().replace(/,/g, '|').replace(/\*/g, '.*')})`),
|
|
31
|
+
pathPattern: createWildcardPathPattern(filteredPath),
|
|
32
|
+
isNegativeMatch: filterModifier === '!',
|
|
39
33
|
};
|
|
40
34
|
}
|
|
41
35
|
|
|
42
|
-
export function groupParsedFiltersByMatch(parsedFilters: (
|
|
36
|
+
export function groupParsedFiltersByMatch(parsedFilters: (TypePathFilter | undefined)[]) {
|
|
43
37
|
return parsedFilters.reduce<TypePathFilters>(
|
|
44
38
|
(groupedFilters, filter) => {
|
|
45
39
|
if (filter) {
|
|
46
40
|
if (filter.isNegativeMatch) {
|
|
47
|
-
groupedFilters.negative.push(filter
|
|
41
|
+
groupedFilters.negative.push(filter);
|
|
48
42
|
} else {
|
|
49
|
-
groupedFilters.positive.push(filter
|
|
43
|
+
groupedFilters.positive.push(filter);
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
46
|
|
|
@@ -712,17 +712,23 @@ export function normalizeMethod(method: ts.TypeElement, context: TypeTransformCo
|
|
|
712
712
|
return undefined;
|
|
713
713
|
}
|
|
714
714
|
|
|
715
|
-
const pathMethodCompareString = `${methodName} ${options.pathName}`;
|
|
716
|
-
|
|
717
715
|
const matchesPositiveFilters =
|
|
718
716
|
context.filters.paths.positive.length === 0 ||
|
|
719
|
-
context.filters.paths.positive.some(
|
|
717
|
+
context.filters.paths.positive.some(
|
|
718
|
+
(filter) => filter.methodPattern.test(methodName) && filter.pathPattern.test(options.pathName),
|
|
719
|
+
);
|
|
720
|
+
|
|
721
|
+
if (!matchesPositiveFilters) {
|
|
722
|
+
return undefined;
|
|
723
|
+
}
|
|
720
724
|
|
|
721
725
|
const matchesNegativeFilters =
|
|
722
726
|
context.filters.paths.negative.length > 0 &&
|
|
723
|
-
context.filters.paths.negative.some(
|
|
727
|
+
context.filters.paths.negative.some(
|
|
728
|
+
(filter) => filter.methodPattern.test(methodName) && filter.pathPattern.test(options.pathName),
|
|
729
|
+
);
|
|
724
730
|
|
|
725
|
-
if (
|
|
731
|
+
if (matchesNegativeFilters) {
|
|
726
732
|
return undefined;
|
|
727
733
|
}
|
|
728
734
|
|
package/src/types/schema.ts
CHANGED
|
@@ -248,10 +248,62 @@ export type HttpSchemaMethod<Schema extends HttpSchema> = IfAny<
|
|
|
248
248
|
keyof UnionToIntersection<Schema[keyof Schema]> & HttpMethod
|
|
249
249
|
>;
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
type RepeatingPathParamModifier = '+';
|
|
252
|
+
type OptionalPathParamModifier = '?' | '*';
|
|
253
|
+
|
|
254
|
+
type ConvertPathParamToRecord<PathParam extends string> = PathParam extends `${infer PathParamWithoutSlash}/`
|
|
255
|
+
? ConvertPathParamToRecord<PathParamWithoutSlash>
|
|
256
|
+
: PathParam extends `${infer PathParamWithoutModifier}${OptionalPathParamModifier}`
|
|
257
|
+
? { [Name in PathParamWithoutModifier]?: string }
|
|
258
|
+
: PathParam extends `${infer PathParamWithoutModifier}${RepeatingPathParamModifier}`
|
|
259
|
+
? { [Name in PathParamWithoutModifier]: string }
|
|
260
|
+
: { [Name in PathParam]: string };
|
|
261
|
+
|
|
262
|
+
type RecursiveInferPathParams<Path extends string> = Path extends `${infer Prefix}:${infer PathParamWithRemainingPath}`
|
|
263
|
+
? PathParamWithRemainingPath extends `${infer PathParam}/${infer RemainingPath}`
|
|
264
|
+
? Prefix extends `${string}\\`
|
|
265
|
+
? RecursiveInferPathParams<RemainingPath>
|
|
266
|
+
: ConvertPathParamToRecord<PathParam> & RecursiveInferPathParams<RemainingPath>
|
|
267
|
+
: PathParamWithRemainingPath extends `${infer PathParam}\\:${infer RemainingPath}`
|
|
268
|
+
? Prefix extends `${string}\\`
|
|
269
|
+
? RecursiveInferPathParams<`\\:${RemainingPath}`>
|
|
270
|
+
: ConvertPathParamToRecord<PathParam> & RecursiveInferPathParams<`\\:${RemainingPath}`>
|
|
271
|
+
: PathParamWithRemainingPath extends `${infer PathParam}:${infer RemainingPath}`
|
|
272
|
+
? Prefix extends `${string}\\`
|
|
273
|
+
? RecursiveInferPathParams<RemainingPath>
|
|
274
|
+
: ConvertPathParamToRecord<PathParam> & RecursiveInferPathParams<`:${RemainingPath}`>
|
|
275
|
+
: Prefix extends `${string}\\`
|
|
276
|
+
? {}
|
|
277
|
+
: ConvertPathParamToRecord<PathParamWithRemainingPath>
|
|
278
|
+
: {};
|
|
279
|
+
|
|
280
|
+
/** @see {@link https://zimic.dev/docs/http/api/http-schema#inferpathparams `InferPathParams` API reference} */
|
|
281
|
+
export type InferPathParams<
|
|
282
|
+
PathOrSchema extends string | HttpSchema,
|
|
283
|
+
OptionalPath extends PathOrSchema extends HttpSchema ? HttpSchemaPath.Literal<PathOrSchema> : never = never,
|
|
284
|
+
> = Prettify<
|
|
285
|
+
RecursiveInferPathParams<
|
|
286
|
+
PathOrSchema extends HttpSchema ? OptionalPath : PathOrSchema extends string ? PathOrSchema : never
|
|
287
|
+
>
|
|
288
|
+
>;
|
|
289
|
+
|
|
290
|
+
export type AllowAnyStringInPathParams<Path extends string> =
|
|
291
|
+
Path extends `${infer Prefix}:${infer PathParamWithRemainingPath}`
|
|
292
|
+
? PathParamWithRemainingPath extends `${infer PathParam}/${infer RemainingPath}`
|
|
293
|
+
? Prefix extends `${string}\\`
|
|
294
|
+
? `${Prefix}:${PathParam}/${AllowAnyStringInPathParams<RemainingPath>}`
|
|
295
|
+
: `${Prefix}${string}/${AllowAnyStringInPathParams<RemainingPath>}`
|
|
296
|
+
: PathParamWithRemainingPath extends `${infer PathParam}\\:${infer RemainingPath}`
|
|
297
|
+
? Prefix extends `${string}\\`
|
|
298
|
+
? `${Prefix}:${PathParam}\\:${AllowAnyStringInPathParams<`\\:${RemainingPath}`>}`
|
|
299
|
+
: `${Prefix}${string}\\:${AllowAnyStringInPathParams<`\\:${RemainingPath}`>}`
|
|
300
|
+
: PathParamWithRemainingPath extends `${infer PathParam}:${infer RemainingPath}`
|
|
301
|
+
? Prefix extends `${string}\\`
|
|
302
|
+
? `${Prefix}:${PathParam}:${AllowAnyStringInPathParams<`:${RemainingPath}`>}`
|
|
303
|
+
: `${Prefix}${string}:${AllowAnyStringInPathParams<`:${RemainingPath}`>}`
|
|
304
|
+
: Prefix extends `${string}\\`
|
|
305
|
+
? `${Prefix}:${PathParamWithRemainingPath}`
|
|
306
|
+
: `${Prefix}${string}`
|
|
255
307
|
: Path;
|
|
256
308
|
|
|
257
309
|
/** @see {@link https://zimic.dev/docs/http/api/http-schema#httpschemapath `HttpSchemaPath` API reference} */
|
|
@@ -309,22 +361,6 @@ export type LiteralHttpSchemaPathFromNonLiteral<
|
|
|
309
361
|
LiteralPath extends LiteralPath ? RecursiveInferHttpSchemaPath<Schema, Method, NonLiteralPath, LiteralPath> : never
|
|
310
362
|
>;
|
|
311
363
|
|
|
312
|
-
type RecursiveInferPathParams<Path extends string> = Path extends `${infer _Prefix}:${infer ParamName}/${infer Suffix}`
|
|
313
|
-
? { [Name in ParamName]: string } & RecursiveInferPathParams<Suffix>
|
|
314
|
-
: Path extends `${infer _Prefix}:${infer ParamName}`
|
|
315
|
-
? { [Name in ParamName]: string }
|
|
316
|
-
: {};
|
|
317
|
-
|
|
318
|
-
/** @see {@link https://zimic.dev/docs/http/api/http-schema#inferpathparams `InferPathParams` API reference} */
|
|
319
|
-
export type InferPathParams<
|
|
320
|
-
PathOrSchema extends string | HttpSchema,
|
|
321
|
-
OptionalPath extends PathOrSchema extends HttpSchema ? HttpSchemaPath.Literal<PathOrSchema> : never = never,
|
|
322
|
-
> = Prettify<
|
|
323
|
-
RecursiveInferPathParams<
|
|
324
|
-
PathOrSchema extends HttpSchema ? OptionalPath : PathOrSchema extends string ? PathOrSchema : never
|
|
325
|
-
>
|
|
326
|
-
>;
|
|
327
|
-
|
|
328
364
|
type OmitPastHttpStatusCodes<
|
|
329
365
|
Schema extends HttpResponseSchemaByStatusCode,
|
|
330
366
|
PastSchemas extends HttpResponseSchemaByStatusCode[],
|