@zimic/http 0.4.0-canary.0 → 0.4.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/README.md +1 -1
- package/dist/{chunk-IJVT4RDC.mjs → chunk-KVTV4E5K.mjs} +26 -100
- package/dist/chunk-KVTV4E5K.mjs.map +1 -0
- package/dist/{chunk-DIZB36SQ.js → chunk-LOHINQWU.js} +26 -100
- package/dist/chunk-LOHINQWU.js.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 +140 -195
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/typegen.js +2 -2
- package/dist/typegen.mjs +1 -1
- package/package.json +2 -2
- package/src/formData/HttpFormData.ts +44 -54
- package/src/formData/types.ts +36 -42
- package/src/headers/HttpHeaders.ts +38 -35
- package/src/headers/types.ts +2 -2
- package/src/pathParams/types.ts +29 -40
- package/src/searchParams/HttpSearchParams.ts +57 -49
- package/src/searchParams/types.ts +39 -45
- package/src/typegen/openapi/transform/components.ts +1 -11
- package/src/typegen/openapi/transform/context.ts +0 -3
- package/src/typegen/openapi/transform/methods.ts +23 -88
- package/src/typegen/openapi/transform/operations.ts +1 -11
- package/src/typegen/openapi/transform/paths.ts +1 -17
- package/src/types/requests.ts +60 -19
- package/src/types/schema.ts +50 -134
- package/dist/chunk-DIZB36SQ.js.map +0 -1
- package/dist/chunk-IJVT4RDC.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../zimic-utils/dist/chunk-6IEM75FG.mjs","../../zimic-utils/src/data/isDefined.ts","../src/typegen/openapi/utils/types.ts","../src/types/schema.ts","../../zimic-utils/src/logging/Logger.ts","../src/utils/logging.ts","../src/typegen/openapi/transform/operations.ts","../src/typegen/openapi/transform/methods.ts","../src/typegen/openapi/transform/paths.ts","../src/typegen/openapi/transform/components.ts","../src/utils/strings.ts","../../zimic-utils/src/data/isNonEmpty.ts","../../zimic-utils/src/url/prepareURLForRegex.ts","../../zimic-utils/src/url/createRegExpFromWildcardPath.ts","../src/typegen/openapi/transform/filters.ts","../src/typegen/openapi/transform/context.ts","../src/typegen/openapi/transform/imports.ts","../../zimic-utils/src/import/createCachedDynamicImport.ts","../src/typegen/openapi/transform/io.ts","../src/typegen/openapi/generate.ts"],"names":["__defProp","__name","ts","color","type","isComponent","path","node","componentPath","filesystem","generateTypesFromOpenAPI"],"mappings":";;;;;;;;;;;;;;;;;;AACA,IAAIA,aAAY,MAAO,CAAA,cAAA;AAKvB,IAAIC,OAAS,mBAAA,MAAA,CAAA,CAAC,MAAQ,EAAA,KAAA,KAAUD,UAAU,CAAA,MAAA,EAAQ,MAAQ,EAAA,EAAE,KAAO,EAAA,YAAA,EAAc,IAAK,EAAC,CAA1E,EAAA,QAAA,CAAA;;;ACNb,SAAS,UAAiB,KAA2C,EAAA;AAC5D,EAAA,OAAA,KAAA,KAAU,UAAa,KAAU,KAAA,IAAA;AAC1C;AAFS,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA;AAAAC,OAAAA,CAAA,WAAA,WAAA,CAAA;AAIT,IAAO,iBAAQ,GAAA,SAAA;ACFR,SAAS,YAAY,IAAmB,EAAA;AAC7C,EAAO,OAAA,IAAA,CAAK,IAAS,KAAAC,oBAAA,CAAG,UAAW,CAAA,YAAA;AACrC;AAFgB,MAAA,CAAA,WAAA,EAAA,aAAA,CAAA;AAIT,SAAS,cAAc,IAAmB,EAAA;AAC/C,EAAO,OAAA,IAAA,CAAK,IAAS,KAAAA,oBAAA,CAAG,UAAW,CAAA,cAAA;AACrC;AAFgB,MAAA,CAAA,aAAA,EAAA,eAAA,CAAA;AAYT,SAAS,WAAW,IAAmD,EAAA;AAC5E,EAAO,OAAA,IAAA,CAAK,IAAS,KAAAA,oBAAA,CAAG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A,KAAA,MAAW,eAAe,kBAAoB,EAAA;AAC5C,IAAA,KAAA,CAAM,QAAQ,WAAW,CAAA;AAAA;AAG3B,EAAA,MAAM,aAAa,MAAM,oBAAA,CAAqB,KAAO,EAAA,EAAE,iBAAiB,CAAA;AACxE,EAAM,MAAA,eAAA,GAAkB,wBAAwB,UAAU,CAAA;AAE1D,EAAA,MAAM,sBAAsB,cAAmB,KAAA,MAAA;AAC/C,EAAA,IAAI,mBAAqB,EAAA;AACvB,IAAA,MAAM,gCAAgC,eAAe,CAAA;AAAA,GAChD,MAAA;AACL,IAAA,MAAMO,4BAAW,SAAUH,CAAAA,qBAAAA,CAAK,OAAQ,CAAA,cAAc,GAAG,eAAe,CAAA;AAAA;AAE5E;AA/Be,MAAA,CAAA,wBAAA,EAAA,0BAAA,CAAA;AAiCf,IAAO,gBAAQ,GAAA","file":"chunk-DIZB36SQ.js","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 __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\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, __require, __toESM };\n//# sourceMappingURL=chunk-6IEM75FG.mjs.map\n//# sourceMappingURL=chunk-6IEM75FG.mjs.map","function isDefined<Value>(value: Value): value is NonNullable<Value> {\n return value !== undefined && value !== null;\n}\n\nexport default isDefined;\n","import ts from 'typescript';\n\nexport function isNeverType(type: ts.TypeNode) {\n return type.kind === ts.SyntaxKind.NeverKeyword;\n}\n\nexport function isUnknownType(type: ts.TypeNode) {\n return type.kind === ts.SyntaxKind.UnknownKeyword;\n}\n\nexport function isNumericType(type: ts.TypeNode) {\n return type.kind === ts.SyntaxKind.NumberKeyword;\n}\n\nexport function isBooleanType(type: ts.TypeNode) {\n return type.kind === ts.SyntaxKind.BooleanKeyword;\n}\n\nexport function isNullType(type: ts.TypeNode | ts.LiteralTypeNode['literal']) {\n return type.kind === ts.SyntaxKind.NullKeyword;\n}\n\nexport function createBlobType() {\n return ts.factory.createTypeReferenceNode('Blob');\n}\n\nexport function createNullType() {\n return ts.factory.createLiteralTypeNode(ts.factory.createNull());\n}\n\nexport function createImportSpecifier(importName: string) {\n return ts.factory.createImportSpecifier(false, undefined, ts.factory.createIdentifier(importName));\n}\n\nexport function createImportDeclaration(\n importSpecifiers: ts.ImportSpecifier[],\n moduleName: string,\n options: { typeOnly: boolean },\n) {\n return ts.factory.createImportDeclaration(\n undefined,\n ts.factory.createImportClause(options.typeOnly, undefined, ts.factory.createNamedImports(importSpecifiers)),\n ts.factory.createStringLiteral(moduleName),\n );\n}\n","import { IfAny, UnionToIntersection, UnionHasMoreThanOneType, Prettify, NonEmptyArray } from '@zimic/utils/types';\n\nimport { HttpFormDataSchema, HttpFormDataSerialized } from '../formData/types';\nimport { HttpHeadersSchema, HttpHeadersSerialized } from '../headers/types';\nimport { HttpPathParamsSchema, HttpPathParamsSerialized } from '../pathParams/types';\nimport { HttpSearchParamsSchema, HttpSearchParamsSerialized } 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://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\nexport interface HttpRequestSchema {\n headers?: HttpHeadersSchema.Loose;\n searchParams?: HttpSearchParamsSchema.Loose;\n body?: HttpBody.Loose;\n}\n\nexport namespace HttpRequestSchema {\n /** Convert an HTTP request schema to be strictly typed. */\n export type AsStrict<Schema> = {\n [Key in keyof Schema]: Key extends 'headers'\n ? HttpHeadersSerialized<Schema[Key]>\n : Key extends 'searchParams'\n ? HttpSearchParamsSerialized<Schema[Key]>\n : Key extends 'body'\n ? HttpBody.AsStrict<Schema[Key]>\n : Schema[Key];\n };\n}\n\n/**\n * A schema representing the structure of an HTTP response.\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\nexport interface HttpResponseSchema {\n headers?: HttpHeadersSchema.Loose;\n body?: HttpBody.Loose;\n}\n\nexport namespace HttpResponseSchema {\n /** A schema representing the structure of an HTTP response with no body. */\n export interface NoBody extends Omit<HttpResponseSchema, 'body'> {\n body?: null;\n }\n\n /** Convert an HTTP response schema to be strictly typed. */\n export type AsStrict<Schema> = HttpRequestSchema.AsStrict<Schema>;\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://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\nexport type HttpResponseSchemaByStatusCode =\n HttpResponseSchemaByStatusCode.AsStrict<HttpResponseSchemaByStatusCode.Loose>;\n\nexport namespace HttpResponseSchemaByStatusCode {\n /** A loose version of HTTP responses by status code. JSON values are not strictly typed. */\n export type Loose = {\n [StatusCode in HttpStatusCode]?: HttpResponseSchema;\n };\n\n /** Converts an HTTP response schema by status code to be strictly typed. */\n export type AsStrict<Schema> = {\n [StatusCode in keyof Schema]: StatusCode extends 204\n ? HttpResponseSchema.NoBody\n : HttpResponseSchema.AsStrict<Schema[StatusCode]>;\n };\n\n /** A schema representing the structure of HTTP responses by status code with no body. */\n export type NoBody = {\n [StatusCode in HttpStatusCode]?: HttpResponseSchema.NoBody;\n };\n}\n\n/**\n * Extracts the status codes used in a response schema by status code.\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\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://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\nexport interface HttpMethodSchema {\n request?: HttpRequestSchema;\n response?: HttpResponseSchemaByStatusCode;\n}\n\nexport namespace HttpMethodSchema {\n /** A schema representing the structure of an HTTP request and response for a given method, having no request body. */\n export interface NoRequestBody extends Omit<HttpMethodSchema, 'request'> {\n request?: Omit<HttpRequestSchema, 'body'> & { body?: null };\n }\n\n /**\n * A schema representing the structure of an HTTP request and response for a given method, having no request and\n * response bodies.\n */\n export interface NoBody extends Omit<NoRequestBody, 'response'> {\n response?: HttpResponseSchemaByStatusCode.NoBody;\n }\n\n /** Converts an HTTP method schema to be strictly typed. */\n export type AsStrict<Schema> = {\n [Key in keyof Schema]: Key extends 'request'\n ? HttpRequestSchema.AsStrict<Schema[Key]>\n : Key extends 'response'\n ? HttpResponseSchemaByStatusCode.AsStrict<Schema[Key]>\n : Schema[Key];\n };\n}\n\n/**\n * A schema representing the structure of HTTP request and response by method.\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\nexport interface HttpMethodsSchema {\n GET?: HttpMethodSchema.NoRequestBody;\n POST?: HttpMethodSchema;\n PUT?: HttpMethodSchema;\n PATCH?: HttpMethodSchema;\n DELETE?: HttpMethodSchema;\n HEAD?: HttpMethodSchema.NoBody;\n OPTIONS?: HttpMethodSchema.NoRequestBody;\n}\n\nexport namespace HttpMethodsSchema {\n /** Converts an HTTP methods schema to be strictly typed. */\n export type AsStrict<Schema> = {\n [Method in keyof Schema]: HttpMethodSchema.AsStrict<Schema[Method]>;\n };\n}\n\ninterface BaseHttpSchema {\n [path: string]: HttpMethodsSchema;\n}\n\n/**\n * Declares an HTTP service schema.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * interface UserListHeaders {\n * accept: string;\n * }\n *\n * interface UserListSearchParams {\n * name?: string;\n * limit?: `${number}`;\n * }\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * request: {\n * headers: UserListHeaders;\n * searchParams: UserListSearchParams;\n * };\n * response: {\n * 200: {\n * // Inline headers declaration\n * headers: { 'content-type': string };\n * body: User[];\n * };\n * };\n * };\n * };\n * }>;\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\nexport type HttpSchema<Schema extends BaseHttpSchema = BaseHttpSchema> = HttpSchema.AsStrict<Schema>;\n\nexport namespace HttpSchema {\n /** Converts an HTTP service schema to be strictly typed. */\n export type AsStrict<Schema extends BaseHttpSchema> = {\n [Path in keyof Schema]: HttpMethodsSchema.AsStrict<Schema[Path]>;\n };\n\n /**\n * Declares an HTTP service methods schema.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserMethods = HttpSchema.Methods<{\n * GET: {\n * response: {\n * 200: { body: User[] };\n * };\n * };\n * }>;\n *\n * type Schema = HttpSchema<{\n * '/users': UserMethods;\n * }>;\n */\n export type Methods<Schema extends HttpMethodsSchema> = HttpMethodsSchema.AsStrict<Schema>;\n\n /**\n * Declares an HTTP service method schema.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserListMethod = HttpSchema.Method<{\n * response: {\n * 200: { body: User[] };\n * };\n * }>;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: UserListMethod;\n * };\n * }>;\n */\n export type Method<Schema extends HttpMethodSchema> = HttpMethodSchema.AsStrict<Schema>;\n\n /**\n * Declares an HTTP service request schema.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserCreationRequest = HttpSchema.Request<{\n * headers: { 'content-type': 'application/json' };\n * body: User;\n * }>;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * POST: {\n * request: UserCreationRequest;\n * response: {\n * 201: { body: User };\n * };\n * };\n * };\n * }>;\n */\n export type Request<Schema extends HttpRequestSchema> = HttpRequestSchema.AsStrict<Schema>;\n\n /**\n * Declares an HTTP service response schema by status code.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserListResponseByStatusCode = HttpSchema.ResponseByStatusCode<{\n * 200: { body: User[] };\n * 400: { body: { message: string } };\n * }>;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * response: UserListResponseByStatusCode;\n * };\n * };\n * }>;\n */\n export type ResponseByStatusCode<Schema extends HttpResponseSchemaByStatusCode> =\n HttpResponseSchemaByStatusCode.AsStrict<Schema>;\n\n /**\n * Declares an HTTP service response schema.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserListSuccessResponse = HttpSchema.Response<{\n * body: User[];\n * }>;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * response: {\n * 200: UserListSuccessResponse;\n * };\n * };\n * };\n * }>;\n */\n export type Response<Schema extends HttpResponseSchema> = HttpResponseSchema.AsStrict<Schema>;\n\n /**\n * Declares an HTTP body schema. JSON values are serialized to their strict form using\n * {@link https://github.com/zimicjs/zimic/wiki/api‐zimic#jsonserialized `JSONSerialized`} if necessary.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserListSuccessResponseBody = HttpSchema.Body<User[]>;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * response: {\n * 200: { body: UserListSuccessResponseBody };\n * };\n * };\n * };\n * }>;\n */\n export type Body<Schema extends HttpBody.Loose> = HttpBody.AsStrict<Schema>;\n\n /**\n * Declares an HTTP headers schema. Headers are serialized to their strict form using\n * {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http#httpheadersserialized `HttpHeadersSerialized`} if\n * necessary.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserListHeaders = HttpSchema.Headers<{\n * accept: 'application/json';\n * }>;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * request: {\n * headers: UserListHeaders;\n * };\n * response: {\n * 200: { body: User[] };\n * };\n * };\n * };\n * }>;\n */\n export type Headers<Schema extends HttpHeadersSchema.Loose> = HttpHeadersSerialized<Schema>;\n\n /**\n * Declares an HTTP search params schema. Search params are serialized to their strict form using\n * {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http#httpsearchparamsserialized `HttpSearchParamsSerialized`}\n * if necessary.\n *\n * @example\n * import { type HttpSchema } from '@zimic/http';\n *\n * type UserListSearchParams = HttpSchema.SearchParams<{\n * limit: `${number}`;\n * offset: `${number}`;\n * }>;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * request: {\n * searchParams: UserListSearchParams;\n * };\n * response: {\n * 200: { body: User[] };\n * };\n * };\n * };\n * }>;\n */\n export type SearchParams<Schema extends HttpSearchParamsSchema.Loose> = HttpSearchParamsSerialized<Schema>;\n\n /**\n * Declares an HTTP path params schema. Path params are serialized to their strict form using\n * {@link HttpPathParamsSerialized} if necessary.\n *\n * @example\n * import { type HttpSchema, InferPathParams } from '@zimic/http';\n *\n * type Schema = HttpSchema<{\n * '/users/:userId': {\n * GET: {\n * response: {\n * 200: { body: User };\n * };\n * };\n * };\n * }>;\n *\n * type UserByIdPathParams = HttpSchema.PathParams<{\n * userId: string;\n * }>;\n *\n * // Or infer from the path string\n * type UserByIdPathParams = InferPathParams<Schema, '/users/:userId'>;\n */\n export type PathParams<Schema extends HttpPathParamsSchema.Loose> = HttpPathParamsSerialized<Schema>;\n\n /**\n * Declares an HTTP form data schema. Form data is serialized to their strict form using\n * {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http#httpformdataserialized `HttpFormDataSerialized`} if\n * necessary.\n *\n * @example\n * import { HttpFormData, type HttpSchema } from '@zimic/http';\n *\n * type UserCreationFormData = HttpFormData<\n * HttpSchema.FormData<{\n * name: string;\n * email: string;\n * }>\n * >;\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * POST: {\n * request: {\n * body: UserCreationFormData;\n * };\n * response: {\n * 201: { body: User };\n * };\n * };\n * };\n * }>;\n */\n export type FormData<Schema extends HttpFormDataSchema.Loose> = HttpFormDataSerialized<Schema>;\n}\n\n/**\n * Extracts the methods from an HTTP service schema.\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\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/**\n * Extracts the paths from an HTTP service schema. Optionally receives a second argument with one or more methods to\n * filter the paths with. Only the methods defined in the schema are allowed.\n *\n * @example\n * import { type HttpSchema, type HttpSchemaPath } from '@zimic/http';\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * response: { 200: { body: User[] } };\n * };\n * };\n * '/users/:userId': {\n * DELETE: {\n * response: { 200: { body: User } };\n * };\n * };\n * }>;\n *\n * type Path = HttpSchemaPath<Schema>;\n * // \"/users\" | \"/users/:userId\" | \"/users/${string}\"\n *\n * type GetPath = HttpSchemaPath<Schema, 'GET'>;\n * // \"/users\"\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\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 /**\n * Extracts the literal paths from an HTTP service schema. Optionally receives a second argument with one or more\n * methods to filter the paths with. Only the methods defined in the schema are allowed.\n *\n * @example\n * import { type HttpSchema, type HttpSchemaPath } from '@zimic/http';\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * response: { 200: { body: User[] } };\n * };\n * };\n * '/users/:userId': {\n * DELETE: {\n * response: { 200: { body: User } };\n * };\n * };\n * }>;\n *\n * type LiteralPath = HttpSchemaPath.Literal<Schema>;\n * // \"/users\" | \"/users/:userId\"\n *\n * type LiteralGetPath = HttpSchemaPath.Literal<Schema, 'GET'>;\n * // \"/users\"\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\n export type Literal<\n Schema extends HttpSchema,\n Method extends HttpSchemaMethod<Schema> = HttpSchemaMethod<Schema>,\n > = LooseLiteral<Schema, Method>;\n\n /**\n * Extracts the non-literal paths from an HTTP service schema. Optionally receives a second argument with one or more\n * methods to filter the paths with. Only the methods defined in the schema are allowed.\n *\n * @example\n * import { type HttpSchema, type HttpSchemaPath } from '@zimic/http';\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: {\n * response: { 200: { body: User[] } };\n * };\n * };\n * '/users/:userId': {\n * DELETE: {\n * response: { 200: { body: User } };\n * };\n * };\n * }>;\n *\n * type NonLiteralPath = HttpSchemaPath.NonLiteral<Schema>;\n * // \"/users\" | \"/users/${string}\"\n *\n * type NonLiteralGetPath = HttpSchemaPath.NonLiteral<Schema, 'GET'>;\n * // \"/users\"\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐http‐schemas Declaring HTTP interceptor schemas}\n */\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/**\n * Infers the path parameters schema from a path string, optionally validating it against an {@link HttpSchema}.\n *\n * If the first argument is a {@link HttpSchema} (recommended), the second argument is checked to be a valid path in that\n * schema.\n *\n * @example\n * import { HttpSchema, InferPathParams } from '@zimic/http';\n *\n * type Schema = HttpSchema<{\n * '/users/:userId': {\n * GET: {\n * response: { 200: { body: User } };\n * };\n * };\n * }>;\n *\n * // Using a schema to validate the path (recommended):\n * type PathParams = InferPathParams<Schema, '/users/:userId'>;\n * // { userId: string }\n *\n * @example\n * import { InferPathParams } from '@zimic/http';\n *\n * // Without using a schema to validate the path (works as `PathParamsSchemaFromPath`):\n * type PathParams = InferPathParams<'/users/:userId'>;\n * // { userId: string }\n */\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.Loose,\n PastSchemas extends HttpResponseSchemaByStatusCode.Loose[],\n> =\n PastSchemas extends NonEmptyArray<HttpResponseSchemaByStatusCode.Loose>\n ? Omit<Schema, keyof UnionToIntersection<PastSchemas[number]>>\n : Schema;\n\ntype RecursiveMergeHttpResponsesByStatusCode<\n Schemas extends HttpResponseSchemaByStatusCode.Loose[],\n PastSchemas extends HttpResponseSchemaByStatusCode.Loose[] = [],\n> = Schemas extends [\n infer FirstSchema extends HttpResponseSchemaByStatusCode.Loose,\n ...infer RestSchemas extends HttpResponseSchemaByStatusCode.Loose[],\n]\n ? RestSchemas extends NonEmptyArray<HttpResponseSchemaByStatusCode.Loose>\n ? OmitPastHttpStatusCodes<FirstSchema, PastSchemas> &\n RecursiveMergeHttpResponsesByStatusCode<RestSchemas, [...PastSchemas, FirstSchema]>\n : OmitPastHttpStatusCodes<FirstSchema, PastSchemas>\n : never;\n\n/**\n * Merges multiple HTTP response schemas by status code into a single schema. When there are duplicate status codes, the\n * first declaration takes precedence.\n *\n * @example\n * import { type HttpSchema, type HttpStatusCode, MergeHttpResponsesByStatusCode } from '@zimic/http';\n *\n * // Overriding the 400 status code with a more specific schema\n * // and using a generic schema for all other client errors.\n * type MergedResponseByStatusCode = MergeHttpResponsesByStatusCode<\n * [\n * {\n * 400: { body: { message: string; issues: string[] } };\n * },\n * {\n * [StatusCode in HttpStatusCode.ClientError]: { body: { message: string } };\n * },\n * ]\n * >;\n * // {\n * // 400: { body: { message: string; issues: string[] } };\n * // 401: { body: { message: string}; };\n * // 402: { body: { message: string}; };\n * // 403: { body: { message: string}; };\n * // ...\n * // }\n *\n * type Schema = HttpSchema<{\n * '/users': {\n * GET: { response: MergedResponseByStatusCode };\n * };\n * }>;\n */\nexport type MergeHttpResponsesByStatusCode<\n Schemas extends HttpResponseSchemaByStatusCode.Loose[],\n PastSchemas extends HttpResponseSchemaByStatusCode.Loose[] = [],\n> = HttpResponseSchemaByStatusCode.AsStrict<RecursiveMergeHttpResponsesByStatusCode<Schemas, PastSchemas>>;\n","export type TableLogRow = Record<string, string>;\n\nexport interface TableLogHeader<Row extends TableLogRow> {\n title: string;\n property: keyof Row;\n}\n\nexport interface LoggerOptions {\n prefix?: string;\n}\n\nclass Logger {\n prefix?: string;\n\n raw: Logger;\n\n constructor(options: LoggerOptions = {}) {\n const { prefix } = options;\n\n this.prefix = prefix;\n\n this.raw = prefix ? new Logger({ ...options, prefix: undefined }) : this;\n }\n\n private logWithLevel(level: 'log' | 'warn' | 'error', ...messages: unknown[]) {\n if (this.prefix) {\n console[level](this.prefix, ...messages);\n } else {\n console[level](...messages);\n }\n }\n\n info(...messages: unknown[]) {\n this.logWithLevel('log', ...messages);\n }\n\n warn(...messages: unknown[]) {\n this.logWithLevel('warn', ...messages);\n }\n\n error(...messages: unknown[]) {\n this.logWithLevel('error', ...messages);\n }\n\n table<Row extends TableLogRow>(headers: TableLogHeader<Row>[], rows: Row[]) {\n const columnLengths = headers.map((header) => {\n let maxValueLength = header.title.length;\n\n for (const row of rows) {\n const value = row[header.property];\n\n if (value.length > maxValueLength) {\n maxValueLength = value.length;\n }\n }\n\n return maxValueLength;\n });\n\n const formattedRows: string[][] = [];\n\n const horizontalLine = columnLengths.map((length) => '─'.repeat(length));\n formattedRows.push(horizontalLine, []);\n\n for (let headerIndex = 0; headerIndex < headers.length; headerIndex++) {\n const header = headers[headerIndex];\n const columnLength = columnLengths[headerIndex];\n\n const value = header.title;\n formattedRows.at(-1)?.push(value.padEnd(columnLength, ' '));\n }\n\n formattedRows.push(horizontalLine);\n\n for (const row of rows) {\n formattedRows.push([]);\n\n for (let headerIndex = 0; headerIndex < headers.length; headerIndex++) {\n const header = headers[headerIndex];\n const columnLength = columnLengths[headerIndex];\n\n const value = row[header.property];\n formattedRows.at(-1)?.push(value.padEnd(columnLength, ' '));\n }\n }\n\n formattedRows.push(horizontalLine);\n\n const formattedTable = formattedRows\n .map((row, index) => {\n const isFirstLine = index === 0;\n if (isFirstLine) {\n return `┌─${row.join('─┬─')}─┐`;\n }\n\n const isLineAfterHeaders = index === 2;\n if (isLineAfterHeaders) {\n return `├─${row.join('─┼─')}─┤`;\n }\n\n const isLastLine = index === formattedRows.length - 1;\n if (isLastLine) {\n return `└─${row.join('─┴─')}─┘`;\n }\n\n return `│ ${row.join(' │ ')} │`;\n })\n .join('\\n');\n\n this.logWithLevel('log', formattedTable);\n }\n}\n\nexport default Logger;\n","import Logger from '@zimic/utils/logging/Logger';\nimport color from 'picocolors';\n\nexport const logger = new Logger({\n prefix: color.cyan('[@zimic/http]'),\n});\n","import isDefined from '@zimic/utils/data/isDefined';\nimport { Override } from '@zimic/utils/types';\nimport ts from 'typescript';\n\nimport { TypeTransformContext } from './context';\nimport { normalizeTypeLiteralMethodType } from './methods';\n\nexport function createOperationsIdentifierText(serviceName: string) {\n return `${serviceName}Operations`;\n}\n\nexport function createOperationsIdentifier(serviceName: string) {\n return ts.factory.createIdentifier(createOperationsIdentifierText(serviceName));\n}\n\ntype OperationsDeclaration = ts.InterfaceDeclaration;\n\nexport function isOperationsDeclaration(node: ts.Node | undefined): node is OperationsDeclaration {\n return node !== undefined && ts.isInterfaceDeclaration(node) && node.name.text === 'operations';\n}\n\ntype Operation = Override<\n ts.PropertySignature,\n {\n type: ts.TypeLiteralNode;\n name: ts.Identifier | ts.StringLiteral;\n }\n>;\n\nfunction isOperation(node: ts.Node): node is Operation {\n return (\n ts.isPropertySignature(node) &&\n (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name)) &&\n node.type !== undefined &&\n ts.isTypeLiteralNode(node.type)\n );\n}\n\nfunction wrapOperationType(type: ts.TypeLiteralNode, context: TypeTransformContext) {\n context.typeImports.http.add('HttpSchema');\n\n const httpSchemaMethodWrapper = ts.factory.createQualifiedName(\n ts.factory.createIdentifier('HttpSchema'),\n ts.factory.createIdentifier('Method'),\n );\n return ts.factory.createTypeReferenceNode(httpSchemaMethodWrapper, [type]);\n}\n\nfunction normalizeOperation(operation: ts.TypeElement, context: TypeTransformContext) {\n /* istanbul ignore if -- @preserve\n * Operation members are always expected to be an operation. */\n if (!isOperation(operation)) {\n return undefined;\n }\n\n const newType = normalizeTypeLiteralMethodType(operation.type, context);\n\n return ts.factory.updatePropertySignature(\n operation,\n operation.modifiers,\n operation.name,\n operation.questionToken,\n wrapOperationType(newType, context),\n );\n}\n\nexport function normalizeOperations(operations: OperationsDeclaration, context: TypeTransformContext) {\n const newIdentifier = createOperationsIdentifier(context.serviceName);\n\n const newMembers = operations.members.map((operation) => normalizeOperation(operation, context)).filter(isDefined);\n\n return ts.factory.updateInterfaceDeclaration(\n operations,\n operations.modifiers,\n newIdentifier,\n operations.typeParameters,\n operations.heritageClauses,\n newMembers,\n );\n}\n\nfunction removeOperationIfUnreferenced(operation: ts.TypeElement, context: TypeTransformContext) {\n /* istanbul ignore if -- @preserve\n * Operation members are always expected to be an operation. */\n if (!isOperation(operation)) {\n return undefined;\n }\n\n const operationName = operation.name.text;\n const isReferenced = context.referencedTypes.operations.has(operationName);\n\n if (isReferenced) {\n context.referencedTypes.operations.delete(operationName);\n return operation;\n }\n\n return undefined;\n}\n\nexport function removeUnreferencedOperations(operations: OperationsDeclaration, context: TypeTransformContext) {\n const newMembers = operations.members\n .map((operation) => removeOperationIfUnreferenced(operation, context))\n .filter(isDefined);\n\n context.referencedTypes.operations.clear();\n\n if (newMembers.length === 0) {\n return undefined;\n }\n\n return ts.factory.updateInterfaceDeclaration(\n operations,\n operations.modifiers,\n operations.name,\n operations.typeParameters,\n operations.heritageClauses,\n newMembers,\n );\n}\n","import isDefined from '@zimic/utils/data/isDefined';\nimport { Override } from '@zimic/utils/types';\nimport color from 'picocolors';\nimport ts from 'typescript';\n\nimport { HTTP_METHODS, HttpMethod } from '@/types/schema';\nimport { logger } from '@/utils/logging';\n\nimport { isUnknownType, isNeverType, isNullType } from '../utils/types';\nimport { renameComponentReferences } from './components';\nimport { TypeTransformContext } from './context';\nimport { createOperationsIdentifier } from './operations';\n\ntype Method = Override<\n ts.PropertySignature,\n {\n type: ts.TypeLiteralNode | ts.IndexedAccessTypeNode;\n name: ts.Identifier;\n }\n>;\n\nfunction isMethod(node: ts.Node): node is Method {\n return (\n ts.isPropertySignature(node) &&\n ts.isIdentifier(node.name) &&\n node.type !== undefined &&\n (ts.isTypeLiteralNode(node.type) || ts.isIndexedAccessTypeNode(node.type))\n );\n}\n\ntype MethodMember = Override<\n ts.PropertySignature,\n {\n name: ts.Identifier | ts.StringLiteral;\n type: ts.TypeLiteralNode | ts.IndexedAccessTypeNode;\n }\n>;\n\nfunction isMethodMember(node: ts.Node): node is MethodMember {\n return (\n ts.isPropertySignature(node) &&\n ts.isIdentifier(node.name) &&\n node.type !== undefined &&\n (ts.isTypeLiteralNode(node.type) || ts.isIndexedAccessTypeNode(node.type) || isNeverType(node.type))\n );\n}\n\ntype RequestMember = Override<\n ts.PropertySignature,\n {\n name: ts.Identifier;\n type: ts.TypeNode;\n }\n>;\n\nfunction isRequestMember(node: ts.Node): node is RequestMember {\n return (\n ts.isPropertySignature(node) && ts.isIdentifier(node.name) && node.type !== undefined && !isNeverType(node.type)\n );\n}\n\ntype RequestHeaders = Override<RequestMember, { type: ts.TypeLiteralNode }>;\n\nfunction isRequestHeaders(node: ts.Node): node is RequestHeaders {\n return isRequestMember(node) && node.name.text === 'headers' && ts.isTypeLiteralNode(node.type);\n}\n\ntype NormalizedRequestHeaders = Override<\n RequestHeaders,\n {\n type: Override<ts.TypeReferenceNode, { typeArguments: ts.NodeArray<ts.TypeLiteralNode> }>;\n }\n>;\n\nfunction isNormalizedRequestHeaders(node: ts.Node): node is NormalizedRequestHeaders {\n return (\n isRequestMember(node) &&\n node.name.text === 'headers' &&\n ts.isTypeReferenceNode(node.type) &&\n node.type.typeArguments !== undefined &&\n node.type.typeArguments.length === 1 &&\n ts.isTypeLiteralNode(node.type.typeArguments[0])\n );\n}\n\ntype RequestParameters = Override<RequestMember, { type: ts.TypeLiteralNode }>;\n\nfunction isRequestParameters(node: ts.Node): node is RequestParameters {\n return isRequestMember(node) && node.name.text === 'parameters' && ts.isTypeLiteralNode(node.type);\n}\n\ntype Content = Override<RequestMember, { type: ts.TypeLiteralNode }>;\n\nfunction isContentPropertySignature(node: ts.Node): node is Content {\n return isRequestMember(node) && node.name.text === 'content' && ts.isTypeLiteralNode(node.type);\n}\n\ntype ContentMember = Override<\n ts.PropertySignature,\n {\n name: ts.Identifier | ts.StringLiteral;\n type: ts.TypeNode;\n }\n>;\n\nfunction isContentMember(node: ts.Node): node is ContentMember {\n return (\n ts.isPropertySignature(node) &&\n (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name)) &&\n node.type !== undefined &&\n !isNeverType(node.type)\n );\n}\n\ntype Response = Override<\n ts.PropertySignature,\n {\n name: ts.Identifier | ts.StringLiteral | ts.NumericLiteral;\n type: ts.TypeNode;\n }\n>;\n\nfunction isResponse(node: ts.Node): node is Response {\n return (\n ts.isPropertySignature(node) &&\n (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name) || ts.isNumericLiteral(node.name)) &&\n node.type !== undefined\n );\n}\n\nfunction removeRedundantNullUnionIfNecessary(type: ts.TypeNode) {\n const containsRedundantNullUnion =\n ts.isUnionTypeNode(type) &&\n type.types.some((type) => {\n const isNull = ts.isLiteralTypeNode(type) && isNullType(type.literal);\n return isNull;\n }) &&\n type.types.some((type) => {\n return (\n ts.isParenthesizedTypeNode(type) &&\n ts.isUnionTypeNode(type.type) &&\n type.type.types.some((subType) => {\n const isNull = ts.isLiteralTypeNode(subType) && isNullType(subType.literal);\n return isNull;\n })\n );\n });\n\n if (!containsRedundantNullUnion) {\n return type;\n }\n\n const typesWithoutRedundantNullUnion = type.types\n .filter((type) => {\n const isNull = ts.isLiteralTypeNode(type) && isNullType(type.literal);\n return !isNull;\n })\n .flatMap((type) => {\n /* istanbul ignore else -- @preserve */\n if (ts.isParenthesizedTypeNode(type) && ts.isUnionTypeNode(type.type)) {\n return type.type.types;\n }\n /* istanbul ignore next -- @preserve\n * Member types are always expected to be a union type or a parenthesized union type. */\n return [type];\n });\n\n return ts.factory.createUnionTypeNode(typesWithoutRedundantNullUnion);\n}\n\nfunction wrapFormDataContentType(type: ts.TypeNode, context: TypeTransformContext) {\n context.typeImports.http.add('HttpFormData');\n context.typeImports.http.add('HttpFormDataSerialized');\n\n return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier('HttpFormData'), [\n ts.factory.createTypeReferenceNode(ts.factory.createIdentifier('HttpFormDataSerialized'), [\n renameComponentReferences(type, context),\n ]),\n ]);\n}\n\nfunction wrapURLEncodedContentType(type: ts.TypeNode, context: TypeTransformContext) {\n context.typeImports.http.add('HttpSearchParams');\n context.typeImports.http.add('HttpSearchParamsSerialized');\n\n return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier('HttpSearchParams'), [\n ts.factory.createTypeReferenceNode(ts.factory.createIdentifier('HttpSearchParamsSerialized'), [\n renameComponentReferences(type, context),\n ]),\n ]);\n}\n\nfunction normalizeRequestBodyMember(\n requestBodyMember: ts.TypeElement,\n context: TypeTransformContext,\n options: { questionToken: ts.QuestionToken | undefined },\n) {\n /* istanbul ignore if -- @preserve\n * Request body members are always expected to be a request body. */\n if (!isContentMember(requestBodyMember)) {\n return undefined;\n }\n\n const newIdentifier = ts.factory.createIdentifier('body');\n\n const contentType = requestBodyMember.name.text;\n let newType = removeRedundantNullUnionIfNecessary(renameComponentReferences(requestBodyMember.type, context));\n\n if (contentType === 'multipart/form-data') {\n newType = wrapFormDataContentType(newType, context);\n } else if (contentType === 'x-www-form-urlencoded') {\n newType = wrapURLEncodedContentType(newType, context);\n }\n\n return {\n contentTypeName: contentType,\n propertySignature: ts.factory.updatePropertySignature(\n requestBodyMember,\n requestBodyMember.modifiers,\n newIdentifier,\n options.questionToken,\n newType,\n ),\n };\n}\n\nfunction wrapHeadersType(type: ts.TypeLiteralNode, context: TypeTransformContext): NormalizedRequestHeaders['type'] {\n context.typeImports.http.add('HttpHeadersSerialized');\n\n const serializedWrapper = ts.factory.createIdentifier('HttpHeadersSerialized');\n\n return ts.factory.createTypeReferenceNode(\n serializedWrapper,\n ts.factory.createNodeArray([type]) satisfies NormalizedRequestHeaders['type']['typeArguments'],\n ) as NormalizedRequestHeaders['type'];\n}\n\nfunction normalizeHeaders(headers: ts.TypeLiteralNode, context: TypeTransformContext) {\n const newHeaderMembers = headers.members.filter((header) => {\n if (ts.isIndexSignatureDeclaration(header)) {\n return false;\n }\n /* istanbul ignore else -- @preserve */\n if (ts.isPropertySignature(header)) {\n return header.type !== undefined && !isUnknownType(header.type);\n }\n /* istanbul ignore next -- @preserve\n * Headers are always expected to be property signatures or index signatures. */\n return true;\n });\n\n if (newHeaderMembers.length === 0) {\n return undefined;\n }\n\n const newHeaders = ts.factory.updateTypeLiteralNode(headers, ts.factory.createNodeArray(newHeaderMembers));\n return wrapHeadersType(newHeaders, context);\n}\n\nfunction normalizeRequestHeaders(\n requestHeader: ts.TypeElement,\n context: TypeTransformContext,\n): NormalizedRequestHeaders | undefined {\n if (!isRequestHeaders(requestHeader)) {\n return undefined;\n }\n\n const newType = normalizeHeaders(requestHeader.type, context);\n\n if (!newType) {\n return undefined;\n }\n\n return ts.factory.updatePropertySignature(\n requestHeader,\n requestHeader.modifiers,\n requestHeader.name,\n requestHeader.questionToken,\n newType satisfies NormalizedRequestHeaders['type'],\n ) satisfies ts.PropertySignature as NormalizedRequestHeaders;\n}\n\nfunction createHeaderForUnionByContentType(\n existingHeader: NormalizedRequestHeaders | undefined,\n contentTypeName: string,\n context: TypeTransformContext,\n) {\n const existingHeaderMembers = existingHeader ? existingHeader.type.typeArguments[0].members : [];\n\n const contentTypeIdentifier = ts.factory.createIdentifier('\"content-type\"');\n const contentTypeValue = ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(contentTypeName));\n\n const newHeaderType = wrapHeadersType(\n ts.factory.createTypeLiteralNode([\n ts.factory.createPropertySignature(undefined, contentTypeIdentifier, undefined, contentTypeValue),\n ...existingHeaderMembers,\n ]),\n context,\n );\n\n return ts.factory.createPropertySignature(\n existingHeader?.modifiers,\n ts.factory.createIdentifier('headers'),\n undefined,\n newHeaderType,\n );\n}\n\nexport function normalizeContentType(\n contentType: ts.TypeNode,\n context: TypeTransformContext,\n options: { bodyQuestionToken: ts.QuestionToken | undefined },\n) {\n const { bodyQuestionToken } = options;\n\n if (ts.isIndexedAccessTypeNode(contentType)) {\n return renameComponentReferences(contentType, context);\n }\n\n if (!ts.isTypeLiteralNode(contentType)) {\n return contentType;\n }\n\n const newHeader = contentType.members.map((member) => normalizeRequestHeaders(member, context)).find(isDefined);\n\n const newBodyMembers = contentType.members.flatMap((body) => {\n if (isContentPropertySignature(body)) {\n return body.type.members\n .map((member) => normalizeRequestBodyMember(member, context, { questionToken: bodyQuestionToken }))\n .filter(isDefined);\n }\n return [];\n });\n\n if (newBodyMembers.length === 0) {\n const newMembers = [newHeader].filter(isDefined);\n\n return ts.factory.updateTypeLiteralNode(contentType, ts.factory.createNodeArray(newMembers));\n } else {\n const bodyMemberUnionTypes = newBodyMembers.map((bodyMember) => {\n const headerMember = createHeaderForUnionByContentType(newHeader, bodyMember.contentTypeName, context);\n return ts.factory.createTypeLiteralNode([headerMember, bodyMember.propertySignature]);\n });\n\n return ts.factory.createUnionTypeNode(bodyMemberUnionTypes);\n }\n}\n\nfunction normalizeRequest(request: MethodMember, context: TypeTransformContext) {\n const newIdentifier = ts.factory.createIdentifier('request');\n\n const newType = normalizeContentType(request.type, context, {\n bodyQuestionToken: request.questionToken,\n });\n\n if (\n request.questionToken &&\n ts.isIndexedAccessTypeNode(request.type) &&\n ts.isLiteralTypeNode(request.type.indexType) &&\n (ts.isIdentifier(request.type.indexType.literal) || ts.isStringLiteral(request.type.indexType.literal))\n ) {\n const referencedComponentName = request.type.indexType.literal.text;\n context.pendingActions.components.requests.toMarkBodyAsOptional.add(referencedComponentName);\n }\n\n return ts.factory.updatePropertySignature(request, request.modifiers, newIdentifier, undefined, newType);\n}\n\nfunction wrapResponseType(type: ts.TypeNode, context: TypeTransformContext) {\n context.typeImports.http.add('HttpSchema');\n\n const httpSchemaResponseWrapper = ts.factory.createQualifiedName(\n ts.factory.createIdentifier('HttpSchema'),\n ts.factory.createIdentifier('Response'),\n );\n return ts.factory.createTypeReferenceNode(httpSchemaResponseWrapper, [type]);\n}\n\nfunction normalizeResponseType(\n responseType: ts.TypeNode,\n context: TypeTransformContext,\n options: { isComponent: boolean; questionToken?: ts.QuestionToken },\n) {\n const { isComponent, questionToken } = options;\n\n if (!ts.isTypeLiteralNode(responseType)) {\n return responseType;\n }\n\n const newType = normalizeContentType(responseType, context, { bodyQuestionToken: questionToken });\n return isComponent ? wrapResponseType(newType, context) : newType;\n}\n\nconst NON_NUMERIC_RESPONSE_STATUS_TO_MAPPED_TYPE: Record<string, string | undefined> = {\n default: 'HttpStatusCode',\n '1xx': 'HttpStatusCode.Information',\n '2xx': 'HttpStatusCode.Success',\n '3xx': 'HttpStatusCode.Redirection',\n '4xx': 'HttpStatusCode.ClientError',\n '5xx': 'HttpStatusCode.ServerError',\n};\n\nexport function normalizeResponse(\n response: ts.TypeElement,\n context: TypeTransformContext,\n options: { isComponent?: boolean } = {},\n) {\n const { isComponent = false } = options;\n\n /* istanbul ignore if -- @preserve\n * Response members are always expected to be a response. */\n if (!isResponse(response)) {\n return undefined;\n }\n\n const newType = normalizeResponseType(response.type, context, {\n isComponent,\n questionToken: response.questionToken,\n });\n\n const statusCodeOrComponentName = response.name.text;\n const isNumericStatusCode = /^\\d+$/.test(statusCodeOrComponentName);\n const shouldReuseIdentifier = isComponent || isNumericStatusCode;\n\n let newSignature: ts.PropertySignature;\n\n if (shouldReuseIdentifier) {\n newSignature = ts.factory.updatePropertySignature(\n response,\n response.modifiers,\n response.name,\n response.questionToken,\n newType,\n );\n } else {\n const statusCode = statusCodeOrComponentName.toLowerCase();\n const mappedType = NON_NUMERIC_RESPONSE_STATUS_TO_MAPPED_TYPE[statusCode];\n\n if (!mappedType) {\n logger.warn(\n `Warning: Response has a non-standard status code: ${color.yellow(response.name.text)}. ` +\n \"Consider replacing it with a number (e.g. '200'), a pattern ('1xx', '2xx', '3xx', '4xx', or '5xx'), \" +\n \"or 'default'.\",\n );\n\n return undefined;\n }\n\n context.typeImports.http.add('HttpStatusCode');\n const newIdentifier = ts.factory.createIdentifier(`[StatusCode in ${mappedType}]`);\n\n newSignature = ts.factory.updatePropertySignature(\n response,\n response.modifiers,\n newIdentifier,\n response.questionToken,\n newType,\n );\n }\n\n return {\n newSignature,\n statusCode: {\n value: statusCodeOrComponentName,\n isNumeric: isNumericStatusCode,\n },\n };\n}\n\nexport function normalizeResponses(responses: MethodMember, context: TypeTransformContext) {\n if (isNeverType(responses.type) || !ts.isTypeLiteralNode(responses.type)) {\n return undefined;\n }\n\n const newIdentifier = ts.factory.createIdentifier('response');\n const newQuestionToken = undefined;\n\n const newMembers = responses.type.members\n .map((response) => normalizeResponse(response, context), context)\n .filter(isDefined);\n\n const sortedNewMembers = Array.from(newMembers).sort((response, otherResponse) => {\n return response.statusCode.value.localeCompare(otherResponse.statusCode.value);\n });\n\n const isEveryStatusCodeNumeric = sortedNewMembers.every((response) => response.statusCode.isNumeric);\n let newType: ts.TypeLiteralNode | ts.TypeReferenceNode;\n\n if (isEveryStatusCodeNumeric) {\n newType = ts.factory.updateTypeLiteralNode(\n responses.type,\n ts.factory.createNodeArray(sortedNewMembers.map((response) => response.newSignature)),\n );\n } else {\n context.typeImports.http.add('MergeHttpResponsesByStatusCode');\n\n const typeMembersToMerge = sortedNewMembers.reduce<{\n numeric: ts.PropertySignature[];\n nonNumeric: ts.PropertySignature[];\n }>(\n (members, response) => {\n if (response.statusCode.isNumeric) {\n members.numeric.push(response.newSignature);\n } else {\n members.nonNumeric.push(response.newSignature);\n }\n return members;\n },\n { numeric: [], nonNumeric: [] },\n );\n\n const numericTypeLiteral = ts.factory.createTypeLiteralNode(typeMembersToMerge.numeric);\n const nonNumericTypeLiterals = typeMembersToMerge.nonNumeric.map((response) =>\n ts.factory.createTypeLiteralNode([response]),\n );\n\n const mergeWrapper = ts.factory.createIdentifier('MergeHttpResponsesByStatusCode');\n newType = ts.factory.createTypeReferenceNode(mergeWrapper, [\n ts.factory.createTupleTypeNode([numericTypeLiteral, ...nonNumericTypeLiterals]),\n ]);\n }\n\n return ts.factory.updatePropertySignature(\n responses,\n responses.modifiers,\n newIdentifier,\n newQuestionToken,\n renameComponentReferences(newType, context),\n );\n}\n\nfunction normalizeMethodMember(methodMember: ts.TypeElement, context: TypeTransformContext) {\n /* istanbul ignore else -- @preserve */\n if (isMethodMember(methodMember)) {\n if (methodMember.name.text === 'requestBody') {\n return normalizeRequest(methodMember, context);\n }\n if (methodMember.name.text === 'responses') {\n return normalizeResponses(methodMember, context);\n }\n return methodMember;\n }\n\n /* istanbul ignore next -- @preserve\n * Method members are always expected as property signatures in methods. */\n return undefined;\n}\n\nfunction normalizeRequestQueryWithParameters(requestMember: RequestMember, context: TypeTransformContext) {\n const newIdentifier = ts.factory.createIdentifier('searchParams');\n const newQuestionToken = undefined;\n\n const newType = renameComponentReferences(requestMember.type, context);\n\n context.typeImports.http.add('HttpSearchParamsSerialized');\n\n const serializedWrapper = ts.factory.createIdentifier('HttpSearchParamsSerialized');\n const wrappedNewType = ts.factory.createTypeReferenceNode(serializedWrapper, [newType]);\n\n return ts.factory.updatePropertySignature(\n requestMember,\n requestMember.modifiers,\n newIdentifier,\n newQuestionToken,\n wrappedNewType,\n );\n}\n\nfunction normalizeRequestHeadersWithParameters(requestMember: RequestMember, context: TypeTransformContext) {\n const newIdentifier = ts.factory.createIdentifier('headers');\n const newQuestionToken = undefined;\n\n const newType = renameComponentReferences(requestMember.type, context);\n\n context.typeImports.http.add('HttpHeadersSerialized');\n\n const serializedWrapper = ts.factory.createIdentifier('HttpHeadersSerialized');\n const wrappedNewType = ts.factory.createTypeReferenceNode(serializedWrapper, [newType]);\n\n return ts.factory.updatePropertySignature(\n requestMember,\n requestMember.modifiers,\n newIdentifier,\n newQuestionToken,\n wrappedNewType,\n );\n}\n\nfunction normalizeRequestMemberWithParameters(requestMember: ts.TypeElement, context: TypeTransformContext) {\n if (!isRequestMember(requestMember) || requestMember.name.text === 'path') {\n return undefined;\n }\n\n if (requestMember.name.text === 'query') {\n return normalizeRequestQueryWithParameters(requestMember, context);\n }\n if (requestMember.name.text === 'header') {\n return normalizeRequestHeadersWithParameters(requestMember, context);\n }\n\n return requestMember;\n}\n\nfunction mergeRequestHeadersMember(headers: NormalizedRequestHeaders, otherHeaders: NormalizedRequestHeaders) {\n const headersTypeLiteral = headers.type.typeArguments[0];\n const otherHeadersTypeLiteral = otherHeaders.type.typeArguments[0];\n\n const newType = ts.factory.updateTypeReferenceNode(\n headers.type,\n headers.type.typeName,\n ts.factory.createNodeArray([\n ts.factory.createTypeLiteralNode([...otherHeadersTypeLiteral.members, ...headersTypeLiteral.members]),\n ]) satisfies NormalizedRequestHeaders['type']['typeArguments'],\n ) as NormalizedRequestHeaders['type'];\n\n return ts.factory.updatePropertySignature(\n headers,\n headers.modifiers,\n headers.name,\n headers.questionToken,\n newType satisfies NormalizedRequestHeaders['type'],\n ) satisfies ts.PropertySignature as NormalizedRequestHeaders;\n}\n\nfunction mergeRequestHeadersMembers(members: (ts.PropertySignature | undefined)[]) {\n let mergedHeaders: NormalizedRequestHeaders | undefined;\n let firstHeadersIndex: number | undefined;\n\n const mergedHeadersMembers = members.map((member, index) => {\n if (!member || !isNormalizedRequestHeaders(member)) {\n return member;\n }\n\n if (firstHeadersIndex === undefined || !mergedHeaders) {\n firstHeadersIndex = index;\n mergedHeaders = member;\n return member;\n }\n\n mergedHeaders = mergeRequestHeadersMember(mergedHeaders, member);\n return undefined;\n });\n\n if (firstHeadersIndex !== undefined) {\n mergedHeadersMembers[firstHeadersIndex] = mergedHeaders;\n }\n\n return mergedHeadersMembers.filter(isDefined);\n}\n\nfunction mergeRequestAndParameterTypes(\n requestType: ts.TypeNode,\n methodMembers: ts.TypeElement[],\n context: TypeTransformContext,\n) {\n const parameters = methodMembers.find(isRequestParameters);\n /* istanbul ignore next -- @preserve\n * Parameters member is always expected to be found. */\n const parametersMembers = parameters ? parameters.type.members : [];\n\n const requestMembers = ts.isTypeLiteralNode(requestType) ? requestType.members : [];\n\n const newMembers = mergeRequestHeadersMembers(\n [...parametersMembers, ...requestMembers].map((member) => {\n return normalizeRequestMemberWithParameters(member, context);\n }),\n );\n\n if (newMembers.length === 0) {\n return undefined;\n }\n\n return ts.factory.createTypeLiteralNode(newMembers);\n}\n\nfunction normalizeRequestTypeWithParameters(\n requestType: ts.TypeNode,\n methodMembers: ts.TypeElement[],\n context: TypeTransformContext,\n): ts.TypeNode | undefined {\n if (ts.isUnionTypeNode(requestType)) {\n const newTypes = requestType.types\n .map((type) => normalizeRequestTypeWithParameters(type, methodMembers, context))\n .filter(isDefined);\n return ts.factory.updateUnionTypeNode(requestType, ts.factory.createNodeArray(newTypes));\n }\n\n if (ts.isIndexedAccessTypeNode(requestType)) {\n const newType = normalizeRequestTypeWithParameters(ts.factory.createTypeLiteralNode([]), methodMembers, context);\n return ts.factory.createIntersectionTypeNode([requestType, newType].filter(isDefined));\n }\n\n return mergeRequestAndParameterTypes(requestType, methodMembers, context);\n}\n\nfunction normalizeMethodMemberWithParameters(\n methodMember: ts.PropertySignature,\n methodMembers: ts.TypeElement[],\n context: TypeTransformContext,\n) {\n /* istanbul ignore if -- @preserve\n * Method members are always expected to have a name and type at this point. */\n if (!ts.isIdentifier(methodMember.name) || !methodMember.type) {\n return undefined;\n }\n\n if (methodMember.name.text === 'request') {\n const newType = normalizeRequestTypeWithParameters(methodMember.type, methodMembers, context);\n\n if (!newType) {\n return undefined;\n }\n\n return ts.factory.updatePropertySignature(\n methodMember,\n methodMember.modifiers,\n methodMember.name,\n undefined,\n newType,\n );\n }\n\n if (methodMember.name.text === 'response') {\n return methodMember;\n }\n\n return undefined;\n}\n\nexport function normalizeTypeLiteralMethodType(methodType: ts.TypeLiteralNode, context: TypeTransformContext) {\n const newMembers = methodType.members\n .map((member) => normalizeMethodMember(member, context))\n .filter(isDefined)\n .map((member, _index, partialMembers) => normalizeMethodMemberWithParameters(member, partialMembers, context))\n .filter(isDefined);\n\n return ts.factory.updateTypeLiteralNode(methodType, ts.factory.createNodeArray(newMembers));\n}\n\nfunction normalizeIndexedAccessMethodType(methodType: ts.IndexedAccessTypeNode, context: TypeTransformContext) {\n const isOperationsReference =\n ts.isTypeReferenceNode(methodType.objectType) &&\n ts.isIdentifier(methodType.objectType.typeName) &&\n methodType.objectType.typeName.text === 'operations';\n\n /* istanbul ignore if -- @preserve\n * In indexed access method types, the reference is always expected to be an operation. */\n if (!isOperationsReference) {\n return methodType;\n }\n\n const newIdentifier = createOperationsIdentifier(context.serviceName);\n const newObjectType = ts.factory.createTypeReferenceNode(newIdentifier, methodType.objectType.typeArguments);\n\n const hasIndexTypeName =\n ts.isLiteralTypeNode(methodType.indexType) &&\n (ts.isIdentifier(methodType.indexType.literal) || ts.isStringLiteral(methodType.indexType.literal));\n\n /* istanbul ignore else -- @preserve\n * In indexed access method types referencing operations, an index type name is always expected. */\n if (hasIndexTypeName) {\n const operationName = methodType.indexType.literal.text;\n context.referencedTypes.operations.add(operationName);\n }\n\n return ts.factory.updateIndexedAccessTypeNode(methodType, newObjectType, methodType.indexType);\n}\n\nexport function normalizeMethod(method: ts.TypeElement, context: TypeTransformContext, options: { pathName: string }) {\n if (!isMethod(method)) {\n return undefined;\n }\n\n const methodName = method.name.text.toUpperCase<HttpMethod>();\n\n if (!HTTP_METHODS.includes(methodName)) {\n return undefined;\n }\n\n const pathMethodCompareString = `${methodName} ${options.pathName}`;\n\n const matchesPositiveFilters =\n context.filters.paths.positive.length === 0 ||\n context.filters.paths.positive.some((filter) => filter.test(pathMethodCompareString));\n\n const matchesNegativeFilters =\n context.filters.paths.negative.length > 0 &&\n context.filters.paths.negative.some((filter) => filter.test(pathMethodCompareString));\n\n if (!matchesPositiveFilters || matchesNegativeFilters) {\n return undefined;\n }\n\n const newIdentifier = ts.factory.createIdentifier(methodName);\n\n const newType = ts.isTypeLiteralNode(method.type)\n ? normalizeTypeLiteralMethodType(method.type, context)\n : normalizeIndexedAccessMethodType(method.type, context);\n\n return ts.factory.updatePropertySignature(method, method.modifiers, newIdentifier, method.questionToken, newType);\n}\n","import isDefined from '@zimic/utils/data/isDefined';\nimport { Override } from '@zimic/utils/types';\nimport ts from 'typescript';\n\nimport { renameComponentReferences } from './components';\nimport { TypeTransformContext } from './context';\nimport { normalizeMethod } from './methods';\n\nexport function createPathsIdentifier(serviceName: string) {\n return ts.factory.createIdentifier(`${serviceName}Schema`);\n}\n\ntype PathsDeclaration = ts.InterfaceDeclaration | ts.TypeAliasDeclaration;\n\nexport function isPathsDeclaration(node: ts.Node | undefined): node is PathsDeclaration {\n return (\n node !== undefined &&\n (ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) &&\n node.name.text === 'paths'\n );\n}\n\ntype Path = Override<\n ts.PropertySignature,\n {\n type: ts.TypeLiteralNode | ts.IndexedAccessTypeNode;\n name: ts.Identifier | ts.StringLiteral;\n }\n>;\n\nfunction isPath(node: ts.TypeElement): node is Path {\n return (\n ts.isPropertySignature(node) &&\n (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name)) &&\n node.type !== undefined &&\n (ts.isTypeLiteralNode(node.type) || ts.isIndexedAccessTypeNode(node.type))\n );\n}\n\nfunction normalizePathNameWithParameters(pathName: string) {\n return pathName.replace(/{([^}]+)}/g, ':$1');\n}\n\nfunction wrapComponentPathType(type: ts.TypeNode, context: TypeTransformContext) {\n context.typeImports.http.add('HttpSchema');\n\n const httpSchemaMethodsWrapper = ts.factory.createQualifiedName(\n ts.factory.createIdentifier('HttpSchema'),\n ts.factory.createIdentifier('Methods'),\n );\n return ts.factory.createTypeReferenceNode(httpSchemaMethodsWrapper, [type]);\n}\n\nexport function normalizePath(\n path: ts.TypeElement,\n context: TypeTransformContext,\n options: { isComponent?: boolean } = {},\n) {\n const { isComponent = false } = options;\n\n /* istanbul ignore if -- @preserve\n * Path members are always expected to be a path. */\n if (!isPath(path)) {\n return undefined;\n }\n\n const newPathName = isComponent ? path.name.text : normalizePathNameWithParameters(path.name.text);\n const newIdentifier = isComponent ? path.name : ts.factory.createStringLiteral(newPathName);\n\n let newType: ts.TypeNode;\n\n if (ts.isTypeLiteralNode(path.type)) {\n const newMethods = path.type.members\n .map((method) => normalizeMethod(method, context, { pathName: newPathName }))\n .filter(isDefined);\n\n if (newMethods.length === 0) {\n return undefined;\n }\n\n newType = ts.factory.updateTypeLiteralNode(path.type, ts.factory.createNodeArray(newMethods));\n } else {\n newType = renameComponentReferences(path.type, context);\n }\n\n return ts.factory.updatePropertySignature(\n path,\n path.modifiers,\n newIdentifier,\n path.questionToken,\n isComponent ? wrapComponentPathType(newType, context) : newType,\n );\n}\n\nfunction wrapPathsType(type: ts.TypeLiteralNode, context: TypeTransformContext) {\n context.typeImports.http.add('HttpSchema');\n\n const httpSchemaPathsWrapper = ts.factory.createIdentifier('HttpSchema');\n return ts.factory.createTypeReferenceNode(httpSchemaPathsWrapper, [type]);\n}\n\nexport function normalizePaths(pathsOrTypeAlias: PathsDeclaration, context: TypeTransformContext) {\n const newIdentifier = createPathsIdentifier(context.serviceName);\n\n const paths = ts.isTypeAliasDeclaration(pathsOrTypeAlias)\n ? ts.factory.createInterfaceDeclaration(pathsOrTypeAlias.modifiers, pathsOrTypeAlias.name, undefined, undefined, [])\n : pathsOrTypeAlias;\n\n const newMembers = paths.members.map((path) => normalizePath(path, context)).filter(isDefined);\n const newType = ts.factory.createTypeLiteralNode(newMembers);\n\n return ts.factory.createTypeAliasDeclaration(\n paths.modifiers,\n newIdentifier,\n paths.typeParameters,\n wrapPathsType(newType, context),\n );\n}\n","import isDefined from '@zimic/utils/data/isDefined';\nimport { Override } from '@zimic/utils/types';\nimport ts from 'typescript';\n\nimport { isNeverType, isUnknownType } from '../utils/types';\nimport { ComponentPath, TypeTransformContext } from './context';\nimport { normalizeContentType, normalizeResponse } from './methods';\nimport { normalizePath } from './paths';\n\nexport function createComponentsIdentifierText(serviceName: string) {\n return `${serviceName}Components`;\n}\n\nfunction createComponentsIdentifier(serviceName: string) {\n return ts.factory.createIdentifier(createComponentsIdentifierText(serviceName));\n}\n\ntype ComponentsDeclaration = ts.InterfaceDeclaration;\n\nexport function isComponentsDeclaration(\n node: ts.Node | undefined,\n context: TypeTransformContext,\n): node is ComponentsDeclaration {\n const componentIdentifiers = ['components', createComponentsIdentifierText(context.serviceName)];\n return node !== undefined && ts.isInterfaceDeclaration(node) && componentIdentifiers.includes(node.name.text);\n}\n\ntype ComponentGroup = Override<\n ts.PropertySignature,\n {\n type: ts.TypeLiteralNode;\n name: ts.Identifier | ts.StringLiteral;\n }\n>;\n\nfunction isComponentGroup(node: ts.TypeElement): node is ComponentGroup {\n return (\n ts.isPropertySignature(node) &&\n node.type !== undefined &&\n ts.isTypeLiteralNode(node.type) &&\n ts.isIdentifier(node.name)\n );\n}\n\ntype Component = Override<\n ts.PropertySignature,\n {\n type: ts.TypeNode;\n name: ts.Identifier | ts.StringLiteral;\n }\n>;\n\nfunction isComponent(node: ts.TypeElement): node is Component {\n return (\n ts.isPropertySignature(node) &&\n node.type !== undefined &&\n !isNeverType(node.type) &&\n (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name))\n );\n}\n\ntype RequestComponent = Override<Component, { type: ts.TypeLiteralNode }>;\n\nfunction isRequestComponent(node: Component): node is RequestComponent {\n return ts.isTypeLiteralNode(node.type);\n}\n\nfunction unchangedIndexedAccessTypeNode(node: ts.IndexedAccessTypeNode) {\n return node;\n}\n\nfunction visitComponentReferences(\n node: ts.TypeNode,\n context: TypeTransformContext & {\n isComponentIndexedAccess?: boolean;\n partialComponentPath?: string[];\n },\n options: {\n onComponentReference: (node: ts.IndexedAccessTypeNode, componentPath: ComponentPath) => void;\n renameComponentReference?: (\n node: ts.IndexedAccessTypeNode,\n resources: {\n objectType: ts.TypeReferenceNode;\n indexType: ts.LiteralTypeNode;\n componentGroupName: string;\n },\n ) => ts.IndexedAccessTypeNode;\n },\n): ts.TypeNode {\n const { onComponentReference, renameComponentReference = unchangedIndexedAccessTypeNode } = options;\n\n if (isUnknownType(node)) {\n return ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword);\n }\n\n if (ts.isTypeReferenceNode(node)) {\n const newTypeArguments = node.typeArguments?.map((type) => visitComponentReferences(type, context, options));\n return ts.factory.updateTypeReferenceNode(node, node.typeName, ts.factory.createNodeArray(newTypeArguments));\n }\n\n if (ts.isArrayTypeNode(node)) {\n const newElementType = visitComponentReferences(node.elementType, context, options);\n return ts.factory.updateArrayTypeNode(node, newElementType);\n }\n\n if (ts.isTupleTypeNode(node)) {\n const newElements = node.elements.map((element) => visitComponentReferences(element, context, options));\n return ts.factory.updateTupleTypeNode(node, ts.factory.createNodeArray(newElements));\n }\n\n if (ts.isUnionTypeNode(node)) {\n const newTypes = node.types.map((type) => visitComponentReferences(type, context, options));\n return ts.factory.updateUnionTypeNode(node, ts.factory.createNodeArray(newTypes));\n }\n\n if (ts.isIntersectionTypeNode(node)) {\n const newTypes = node.types.map((type) => visitComponentReferences(type, context, options));\n return ts.factory.updateIntersectionTypeNode(node, ts.factory.createNodeArray(newTypes));\n }\n\n if (ts.isParenthesizedTypeNode(node)) {\n const newType = visitComponentReferences(node.type, context, options);\n return ts.factory.updateParenthesizedType(node, newType);\n }\n\n if (ts.isTypeLiteralNode(node)) {\n const newMembers = node.members.map((member) => {\n if (ts.isPropertySignature(member) && member.type) {\n const newType = visitComponentReferences(member.type, context, options);\n return ts.factory.updatePropertySignature(member, member.modifiers, member.name, member.questionToken, newType);\n }\n\n /* istanbul ignore else -- @preserve */\n if (ts.isIndexSignatureDeclaration(member)) {\n const newType = visitComponentReferences(member.type, context, options);\n return ts.factory.updateIndexSignature(member, member.modifiers, member.parameters, newType);\n }\n\n /* istanbul ignore next -- @preserve\n * All members are expected to be either a property signature or an index signature. */\n return member;\n });\n\n return ts.factory.updateTypeLiteralNode(node, ts.factory.createNodeArray(newMembers));\n }\n\n if (ts.isIndexedAccessTypeNode(node)) {\n const isRootIndexedAccess = context.isComponentIndexedAccess ?? true;\n\n if (ts.isIndexedAccessTypeNode(node.objectType)) {\n const childContext: typeof context = { ...context, isComponentIndexedAccess: false };\n const newObjectType = visitComponentReferences(node.objectType, childContext, options);\n\n const newNode = ts.factory.updateIndexedAccessTypeNode(node, newObjectType, node.indexType);\n\n /* istanbul ignore else -- @preserve\n * Component indexed accesses are always expected to have child indexed accesses. */\n if (childContext.partialComponentPath && childContext.partialComponentPath.length > 0) {\n const hasIndexTypeName =\n ts.isLiteralTypeNode(node.indexType) &&\n (ts.isIdentifier(node.indexType.literal) || ts.isStringLiteral(node.indexType.literal));\n\n /* istanbul ignore else -- @preserve\n * Component indexed accesses are always expected to have child indexed accesses. */\n if (hasIndexTypeName) {\n const componentName = node.indexType.literal.text;\n childContext.partialComponentPath.push(componentName);\n }\n\n /* istanbul ignore else -- @preserve\n * Component indexed accesses are always expected to have child indexed accesses. */\n if (isRootIndexedAccess) {\n const componentGroupName = childContext.partialComponentPath[0];\n const componentName = childContext.partialComponentPath.slice(1).join('.');\n const componentPath = `${componentGroupName}.${componentName}` as const;\n onComponentReference(newNode, componentPath);\n }\n }\n\n return newNode;\n }\n\n const componentIdentifiers = ['components', createComponentsIdentifierText(context.serviceName)];\n\n const isComponentIndexedAccess =\n ts.isTypeReferenceNode(node.objectType) &&\n ts.isIdentifier(node.objectType.typeName) &&\n componentIdentifiers.includes(node.objectType.typeName.text) &&\n ts.isLiteralTypeNode(node.indexType) &&\n (ts.isIdentifier(node.indexType.literal) || ts.isStringLiteral(node.indexType.literal));\n\n /* istanbul ignore else -- @preserve\n * All indexed accesses are expected to point to components. */\n if (isComponentIndexedAccess) {\n const isRawComponent = node.objectType.typeName.text === 'components';\n const componentGroupName = node.indexType.literal.text;\n\n const newNode = isRawComponent\n ? renameComponentReference(node, {\n objectType: node.objectType,\n indexType: node.indexType,\n componentGroupName,\n })\n : node;\n\n const newNodeHasComponentGroupName =\n ts.isLiteralTypeNode(newNode.indexType) &&\n (ts.isIdentifier(newNode.indexType.literal) || ts.isStringLiteral(newNode.indexType.literal));\n\n /* istanbul ignore else -- @preserve\n * All component indexed accesses are expected to have an index type name. */\n if (newNodeHasComponentGroupName) {\n const newComponentGroupName = newNode.indexType.literal.text;\n context.partialComponentPath = [newComponentGroupName];\n }\n\n return newNode;\n }\n }\n\n return node;\n}\n\nexport function normalizeComponentGroupName(rawComponentGroupName: string) {\n if (rawComponentGroupName === 'requestBodies') {\n return 'requests';\n }\n return rawComponentGroupName;\n}\n\nexport function renameComponentReferences(node: ts.TypeNode, context: TypeTransformContext): ts.TypeNode {\n return visitComponentReferences(node, context, {\n onComponentReference(_node, componentPath) {\n context.referencedTypes.components.add(componentPath);\n },\n\n renameComponentReference(node, { indexType, objectType, componentGroupName }) {\n const newIdentifier = createComponentsIdentifier(context.serviceName);\n const newObjectType = ts.factory.updateTypeReferenceNode(objectType, newIdentifier, objectType.typeArguments);\n\n const newComponentGroupName = normalizeComponentGroupName(componentGroupName);\n const newIndexType = ts.factory.updateLiteralTypeNode(\n indexType,\n ts.factory.createStringLiteral(newComponentGroupName),\n );\n\n return ts.factory.updateIndexedAccessTypeNode(node, newObjectType, newIndexType);\n },\n });\n}\n\nfunction processPendingRequestComponentActions(component: RequestComponent, context: TypeTransformContext) {\n const pendingRequestActions = context.pendingActions.components.requests;\n\n const componentName = component.name.text;\n const shouldBeMarkedAsOptional = pendingRequestActions.toMarkBodyAsOptional.has(componentName);\n\n const bodyQuestionToken = shouldBeMarkedAsOptional\n ? ts.factory.createToken(ts.SyntaxKind.QuestionToken)\n : component.questionToken;\n\n pendingRequestActions.toMarkBodyAsOptional.delete(componentName);\n\n return { bodyQuestionToken };\n}\n\nfunction wrapRequestComponentType(type: ts.TypeNode, context: TypeTransformContext) {\n context.typeImports.http.add('HttpSchema');\n\n const httpSchemaRequestWrapper = ts.factory.createQualifiedName(\n ts.factory.createIdentifier('HttpSchema'),\n ts.factory.createIdentifier('Request'),\n );\n return ts.factory.createTypeReferenceNode(httpSchemaRequestWrapper, [type]);\n}\n\nfunction normalizeRequestComponent(component: Component, context: TypeTransformContext) {\n /* istanbul ignore if -- @preserve\n * Component group members in `requests` are always expected the be request components. */\n if (!isRequestComponent(component)) {\n return undefined;\n }\n\n const { bodyQuestionToken } = processPendingRequestComponentActions(component, context);\n const newType = normalizeContentType(component.type, context, { bodyQuestionToken });\n\n return ts.factory.updatePropertySignature(\n component,\n component.modifiers,\n component.name,\n component.questionToken,\n wrapRequestComponentType(newType, context),\n );\n}\n\nfunction normalizeComponent(\n component: ts.TypeElement,\n componentGroupName: string,\n context: TypeTransformContext,\n): ts.TypeElement | undefined {\n /* istanbul ignore if -- @preserve\n * Component group members are always expected the be components. */\n if (!isComponent(component)) {\n return undefined;\n }\n\n if (componentGroupName === 'requests') {\n return normalizeRequestComponent(component, context);\n }\n\n if (componentGroupName === 'responses') {\n const responseComponent = normalizeResponse(component, context, { isComponent: true });\n return responseComponent?.newSignature;\n }\n\n if (componentGroupName === 'pathItems') {\n return normalizePath(component, context, { isComponent: true });\n }\n\n return ts.factory.updatePropertySignature(\n component,\n component.modifiers,\n component.name,\n component.questionToken,\n renameComponentReferences(component.type, context),\n );\n}\n\nfunction normalizeComponentGroup(componentGroup: ts.TypeElement, context: TypeTransformContext) {\n if (!isComponentGroup(componentGroup)) {\n return undefined;\n }\n\n const componentGroupName = normalizeComponentGroupName(componentGroup.name.text);\n const newIdentifier = ts.factory.createIdentifier(componentGroupName);\n\n const newComponents = componentGroup.type.members\n .map((component) => normalizeComponent(component, componentGroupName, context))\n .filter(isDefined);\n\n const newType = ts.factory.updateTypeLiteralNode(componentGroup.type, ts.factory.createNodeArray(newComponents));\n\n return ts.factory.updatePropertySignature(\n componentGroup,\n componentGroup.modifiers,\n newIdentifier,\n componentGroup.questionToken,\n newType,\n );\n}\n\nexport function normalizeComponents(components: ts.InterfaceDeclaration, context: TypeTransformContext) {\n const newIdentifier = createComponentsIdentifier(context.serviceName);\n\n const newMembers = components.members\n .map((componentGroup) => normalizeComponentGroup(componentGroup, context))\n .filter(isDefined);\n\n return ts.factory.updateInterfaceDeclaration(\n components,\n components.modifiers,\n newIdentifier,\n components.typeParameters,\n components.heritageClauses,\n newMembers,\n );\n}\n\nexport function populateReferencedComponents(components: ts.InterfaceDeclaration, context: TypeTransformContext) {\n const pathsToVisit = new Set(context.referencedTypes.components);\n\n while (pathsToVisit.size > 0) {\n const previousPathsToVisit = new Set(pathsToVisit);\n pathsToVisit.clear();\n\n for (const componentGroup of components.members) {\n if (!isComponentGroup(componentGroup)) {\n continue;\n }\n\n const componentGroupName = normalizeComponentGroupName(componentGroup.name.text);\n\n for (const component of componentGroup.type.members) {\n /* istanbul ignore if -- @preserve\n * Component group members are always expected the be components. */\n if (!isComponent(component)) {\n continue;\n }\n\n const componentName = component.name.text;\n const componentPath = `${componentGroupName}.${componentName}` as const;\n const isComponentToVisit = previousPathsToVisit.has(componentPath);\n\n if (!isComponentToVisit) {\n continue;\n }\n\n context.referencedTypes.components.add(componentPath);\n\n visitComponentReferences(component.type, context, {\n onComponentReference(_node, componentPath) {\n const isKnownReferencedComponent = context.referencedTypes.components.has(componentPath);\n if (!isKnownReferencedComponent) {\n pathsToVisit.add(componentPath);\n }\n },\n });\n }\n }\n }\n}\n\nexport function removeComponentIfUnreferenced(\n component: ts.TypeElement,\n componentGroupName: string,\n context: TypeTransformContext,\n) {\n /* istanbul ignore if -- @preserve\n * Component group members are always expected the be components. */\n if (!isComponent(component)) {\n return undefined;\n }\n\n const componentName = component.name.text;\n const componentPath = `${componentGroupName}.${componentName}` as const;\n\n if (context.referencedTypes.components.has(componentPath)) {\n context.referencedTypes.components.delete(componentPath);\n return component;\n }\n\n return undefined;\n}\n\nfunction removeUnreferencedComponentsInGroup(componentGroup: ts.TypeElement, context: TypeTransformContext) {\n /* istanbul ignore if -- @preserve\n * Component members are always expected the be component groups. */\n if (!isComponentGroup(componentGroup)) {\n return undefined;\n }\n\n const componentGroupName = normalizeComponentGroupName(componentGroup.name.text);\n\n const newComponents = componentGroup.type.members\n .map((component) => removeComponentIfUnreferenced(component, componentGroupName, context))\n .filter(isDefined);\n\n if (newComponents.length === 0) {\n return undefined;\n }\n\n return ts.factory.updatePropertySignature(\n componentGroup,\n componentGroup.modifiers,\n componentGroup.name,\n componentGroup.questionToken,\n ts.factory.updateTypeLiteralNode(componentGroup.type, ts.factory.createNodeArray(newComponents)),\n );\n}\n\nexport function removeUnreferencedComponents(components: ts.InterfaceDeclaration, context: TypeTransformContext) {\n const newComponentGroups = components.members\n .map((componentGroup) => removeUnreferencedComponentsInGroup(componentGroup, context))\n .filter(isDefined);\n\n context.referencedTypes.components.clear();\n\n if (newComponentGroups.length === 0) {\n return undefined;\n }\n\n return ts.factory.updateInterfaceDeclaration(\n components,\n components.modifiers,\n components.name,\n components.typeParameters,\n components.heritageClauses,\n newComponentGroups,\n );\n}\n","export function convertToPascalCase(value: string) {\n return value.replace(/(?:^|[^A-Za-z\\d])([A-Za-z\\d])/g, (_match, letter: string) => letter.toUpperCase());\n}\n","import isDefined from './isDefined';\n\nfunction isNonEmpty<Value>(value: Value): value is Exclude<NonNullable<Value>, ''> {\n return isDefined(value) && value !== '';\n}\n\nexport default isNonEmpty;\n","export function prepareURLForRegex(url: string) {\n const encodedURL = encodeURI(url);\n return encodedURL.replace(/([.()*?+$\\\\])/g, '\\\\$1');\n}\n","import { prepareURLForRegex } from './prepareURLForRegex';\n\nfunction createRegExpFromWildcardPath(path: string, options: { prefix: string }) {\n const pathWithReplacedWildcards = prepareURLForRegex(path)\n .replace(/^\\/+|\\/+$/g, '')\n .replace(/\\\\\\*/g, '*')\n .replace(/\\*\\*\\/\\*/g, '**')\n .replace(/(^|[^*])\\*([^*]|$)/g, '$1[^/]*$2')\n .replace(/\\*\\*/g, '.*');\n\n return new RegExp(`^${options.prefix}/*${pathWithReplacedWildcards}/*$`);\n}\n\nexport default createRegExpFromWildcardPath;\n","import isNonEmpty from '@zimic/utils/data/isNonEmpty';\nimport createRegExpFromWildcardPath from '@zimic/utils/url/createRegExpFromWildcardPath';\nimport filesystem from 'fs/promises';\nimport path from 'path';\nimport color from 'picocolors';\n\nimport { HTTP_METHODS } from '@/types/schema';\nimport { logger } from '@/utils/logging';\n\nimport { TypePathFilters } from './context';\n\nconst HTTP_METHOD_OPTIONS = HTTP_METHODS.join('|');\nconst MODIFIER_GROUP = '(?<modifier>!?)';\nconst METHOD_FILTER_GROUP = `(?<method>(?:\\\\*|(?:${HTTP_METHOD_OPTIONS})(?:,\\\\s*(?:${HTTP_METHOD_OPTIONS}))*))`;\nconst PATH_FILTER_GROUP = '(?<path>.+)';\nconst FILTER_REGEX = new RegExp(`^${MODIFIER_GROUP}\\\\s*${METHOD_FILTER_GROUP}\\\\s+${PATH_FILTER_GROUP}$`, 'i');\n\ninterface ParsedTypePathFilter {\n expression: RegExp;\n isNegativeMatch: boolean;\n}\n\nexport function parseRawFilter(rawFilter: string): ParsedTypePathFilter | undefined {\n const filterMatch = rawFilter.match(FILTER_REGEX);\n const { modifier: filterModifier, method: filteredMethodsOrWildcard, path: filteredPath } = filterMatch?.groups ?? {};\n\n const isValidFilter = !filteredMethodsOrWildcard || !filteredPath;\n if (isValidFilter) {\n logger.warn(`Warning: Filter could not be parsed and was ignored: ${color.yellow(rawFilter)}`);\n return undefined;\n }\n\n const methodFilterGroup = `(?:${filteredMethodsOrWildcard.toUpperCase().replace(/,/g, '|').replace(/\\*/g, '.*')}) `;\n const isNegativeMatch = filterModifier === '!';\n\n return {\n expression: createRegExpFromWildcardPath(filteredPath, { prefix: methodFilterGroup }),\n isNegativeMatch,\n };\n}\n\nexport function groupParsedFiltersByMatch(parsedFilters: (ParsedTypePathFilter | undefined)[]) {\n return parsedFilters.reduce<TypePathFilters>(\n (groupedFilters, filter) => {\n if (filter) {\n if (filter.isNegativeMatch) {\n groupedFilters.negative.push(filter.expression);\n } else {\n groupedFilters.positive.push(filter.expression);\n }\n }\n\n return groupedFilters;\n },\n { positive: [], negative: [] },\n );\n}\n\nexport async function readPathFiltersFromFile(filePath: string) {\n const fileContent = await filesystem.readFile(path.resolve(filePath), 'utf-8');\n const fileContentWithoutComments = fileContent.replace(/#.*$/gm, '');\n\n const filters = fileContentWithoutComments.split('\\n');\n return filters;\n}\n\nexport function ignoreEmptyFilters(filters: string[]) {\n return filters.map((line) => line.trim()).filter(isNonEmpty);\n}\n","import { convertToPascalCase } from '@/utils/strings';\n\nimport { parseRawFilter, groupParsedFiltersByMatch } from './filters';\n\nexport interface TypePathFilters {\n positive: RegExp[];\n negative: RegExp[];\n}\n\ntype HttpTypeImportName =\n | 'HttpSchema'\n | 'HttpFormData'\n | 'HttpFormDataSerialized'\n | 'HttpSearchParams'\n | 'HttpSearchParamsSerialized'\n | 'HttpHeadersSerialized'\n | 'HttpStatusCode'\n | 'MergeHttpResponsesByStatusCode';\n\ntype OperationName = string;\nexport type OperationPath = OperationName;\n\nexport type ComponentGroupName = string;\nexport type ComponentName = string;\nexport type ComponentPath = `${ComponentGroupName}.${ComponentName}`;\n\nexport interface TypeTransformContext {\n serviceName: string;\n filters: {\n paths: TypePathFilters;\n };\n typeImports: {\n http: Set<HttpTypeImportName>;\n };\n referencedTypes: {\n operations: Set<OperationPath>;\n components: Set<ComponentPath>;\n };\n pendingActions: {\n components: {\n requests: { toMarkBodyAsOptional: Set<ComponentName> };\n };\n };\n}\n\nexport function createTypeTransformationContext(serviceName: string, rawFilters: string[]): TypeTransformContext {\n const parsedFilters = rawFilters.map(parseRawFilter);\n\n return {\n serviceName: convertToPascalCase(serviceName),\n filters: {\n paths: groupParsedFiltersByMatch(parsedFilters),\n },\n typeImports: {\n http: new Set(),\n },\n referencedTypes: {\n operations: new Set(),\n components: new Set(),\n },\n pendingActions: {\n components: {\n requests: { toMarkBodyAsOptional: new Set() },\n },\n },\n };\n}\n","import { createImportDeclaration, createImportSpecifier } from '../utils/types';\nimport { TypeTransformContext } from './context';\n\n/* istanbul ignore next -- @preserve\n * The root import module is defined at build time. The fallback is not expected to be used. */\nexport const TYPEGEN_HTTP_IMPORT_MODULE = process.env.TYPEGEN_HTTP_IMPORT_MODULE ?? '@zimic/http';\n\nexport function createImportDeclarations(context: TypeTransformContext) {\n const httpTypeImports = Array.from(context.typeImports.http).sort().map(createImportSpecifier);\n const httpImportDeclaration = createImportDeclaration(httpTypeImports, TYPEGEN_HTTP_IMPORT_MODULE, {\n typeOnly: true,\n });\n\n return [httpImportDeclaration];\n}\n","function createCachedDynamicImport<ImportType>(\n importModuleDynamically: () => Promise<ImportType>,\n): () => Promise<ImportType> {\n let cachedImportResult: ImportType | undefined;\n\n return async function importModuleDynamicallyWithCache() {\n cachedImportResult ??= await importModuleDynamically();\n return cachedImportResult;\n };\n}\n\nexport default createCachedDynamicImport;\n","import createCachedDynamicImport from '@zimic/utils/import/createCachedDynamicImport';\nimport type { SchemaObject } from 'openapi-typescript';\nimport path from 'path';\nimport ts from 'typescript';\n\nimport { createBlobType, createNullType } from '../utils/types';\n\nconst importOpenapiTypeScript = createCachedDynamicImport(() => import('openapi-typescript'));\n\nfunction transformSchemaObject(schemaObject: SchemaObject) {\n if (schemaObject.format === 'binary') {\n const blobType = createBlobType();\n\n if (schemaObject.nullable) {\n const nullType = createNullType();\n return ts.factory.createUnionTypeNode([blobType, nullType]);\n }\n\n return blobType;\n }\n}\n\nfunction convertFilePathOrURLToURL(filePathOrURL: string) {\n try {\n return new URL(filePathOrURL);\n } catch {\n return new URL(`file://${path.resolve(filePathOrURL)}`);\n }\n}\n\nexport async function importTypesFromOpenAPI(filePathOrURL: string) {\n const schemaURL = convertFilePathOrURLToURL(filePathOrURL);\n\n const { default: generateTypesFromOpenAPI } = await importOpenapiTypeScript();\n\n const rawNodes = await generateTypesFromOpenAPI(schemaURL, {\n alphabetize: false,\n additionalProperties: false,\n excludeDeprecated: false,\n propertiesRequiredByDefault: false,\n defaultNonNullable: true,\n pathParamsAsTypes: false,\n emptyObjectsUnknown: true,\n exportType: false,\n arrayLength: false,\n immutable: false,\n enumValues: false,\n enum: false,\n silent: true,\n transform: transformSchemaObject,\n });\n\n return rawNodes;\n}\n\nexport async function convertTypesToString(nodes: ts.Node[], options: { includeComments: boolean }) {\n const { astToString: convertTypeASTToString } = await importOpenapiTypeScript();\n\n const typeOutput = convertTypeASTToString(nodes, {\n formatOptions: { removeComments: !options.includeComments },\n });\n\n return typeOutput;\n}\n\nexport function prepareTypeOutputToSave(output: string) {\n const formattedOutput = output\n .replace(/^export (\\w+)/gm, '\\nexport $1')\n .replace(/^( {4})+/gm, (match) => match.replace(/ {4}/g, ' '));\n\n const formattedOutputWithPrefix = [\n '// Auto-generated by zimic.',\n '// NOTE: Do not manually edit this file. Changes will be overridden.\\n',\n formattedOutput,\n ].join('\\n');\n\n return formattedOutputWithPrefix;\n}\n\nexport async function writeTypeOutputToStandardOutput(formattedOutput: string) {\n await new Promise((resolve) => {\n process.stdout.write(formattedOutput, 'utf-8', resolve);\n });\n}\n","import isDefined from '@zimic/utils/data/isDefined';\nimport filesystem from 'fs/promises';\nimport path from 'path';\nimport ts from 'typescript';\n\nimport {\n isComponentsDeclaration,\n normalizeComponents,\n populateReferencedComponents,\n removeUnreferencedComponents,\n} from './transform/components';\nimport { createTypeTransformationContext, TypeTransformContext } from './transform/context';\nimport { readPathFiltersFromFile, ignoreEmptyFilters } from './transform/filters';\nimport { createImportDeclarations } from './transform/imports';\nimport {\n convertTypesToString,\n importTypesFromOpenAPI,\n prepareTypeOutputToSave,\n writeTypeOutputToStandardOutput,\n} from './transform/io';\nimport { isOperationsDeclaration, normalizeOperations, removeUnreferencedOperations } from './transform/operations';\nimport { isPathsDeclaration, normalizePaths } from './transform/paths';\n\nconst RESOURCES_TO_REMOVE_IF_NOT_NORMALIZED = ['paths', 'webhooks', 'operations', 'components', '$defs'];\n\nfunction removeUnknownResources(node: ts.Node | undefined) {\n const isUnknownResource =\n !node ||\n ((ts.isTypeAliasDeclaration(node) || ts.isInterfaceDeclaration(node)) &&\n RESOURCES_TO_REMOVE_IF_NOT_NORMALIZED.includes(node.name.text));\n\n if (isUnknownResource) {\n return undefined;\n }\n\n return node;\n}\n\nfunction normalizeRawNodes(rawNodes: ts.Node[], context: TypeTransformContext, options: { prune: boolean }) {\n let normalizedNodes = rawNodes.map((node) => (isPathsDeclaration(node) ? normalizePaths(node, context) : node));\n\n if (options.prune) {\n normalizedNodes = normalizedNodes\n .map((node) => (isOperationsDeclaration(node) ? removeUnreferencedOperations(node, context) : node))\n .filter(isDefined);\n }\n\n normalizedNodes = normalizedNodes\n .map((node) => (isOperationsDeclaration(node) ? normalizeOperations(node, context) : node))\n .filter(isDefined);\n\n if (options.prune) {\n for (const node of normalizedNodes) {\n if (isComponentsDeclaration(node, context)) {\n populateReferencedComponents(node, context);\n }\n }\n\n normalizedNodes = normalizedNodes\n .map((node) => (isComponentsDeclaration(node, context) ? removeUnreferencedComponents(node, context) : node))\n .filter(isDefined);\n }\n\n normalizedNodes = normalizedNodes\n .map((node) => (isComponentsDeclaration(node, context) ? normalizeComponents(node, context) : node))\n .map(removeUnknownResources)\n .filter(isDefined);\n\n return normalizedNodes;\n}\n\n/**\n * The options to use when generating types from an OpenAPI schema.\n *\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐typegen#generatetypesfromopenapioptions `generateTypesFromOpenAPI(options)` API reference}\n */\nexport interface OpenAPITypegenOptions {\n /**\n * The path to a local OpenAPI schema file or an URL to fetch it. Version 3 is supported as YAML or JSON.\n *\n * @example\n * './schema.yaml';\n * 'https://example.com/openapi/schema.yaml';\n */\n input: string;\n /**\n * The path to write the generated types to. If not provided, the types will be written to stdout.\n *\n * @example\n * './schema.ts';\n */\n output?: string;\n /**\n * The name of the service to use in the generated types.\n *\n * @example\n * 'MyService';\n */\n serviceName: string;\n /** Whether to include comments in the generated types. */\n includeComments: boolean;\n /**\n * Whether to remove unused operations and components from the generated types. This is useful for reducing the size\n * of the output file.\n */\n prune: boolean;\n /**\n * One or more expressions to filter the types to generate. Filters must follow the format `<method> <path>`, where\n * `<method>` is an HTTP method or `*`, and `<path>` is a literal path or a glob. Filters are case-sensitive regarding\n * paths. Negative filters can be created by prefixing the expression with `!`. If more than one positive filter is\n * provided, they will be combined with OR, while negative filters will be combined with AND.\n *\n * @example\n * ['GET /users', '* /users', 'GET,POST /users/*', 'DELETE /users/**\\\\/*', '!GET /notifications'];\n */\n filters?: string[];\n /**\n * A path to a file containing filter expressions. One expression is expected per line and the format is the same as\n * used in a `--filter` option. Comments are prefixed with `#`. A filter file can be used alongside additional\n * `--filter` expressions.\n *\n * @example\n * './filters.txt';\n */\n filterFile?: string;\n}\n\n/**\n * Generates TypeScript types from an OpenAPI schema.\n *\n * @param options The options to use when generating the types.\n * @see {@link https://github.com/zimicjs/zimic/wiki/api‐zimic‐typegen#generatetypesfromopenapioptions `generateTypesFromOpenAPI(options)` API reference}\n */\nasync function generateTypesFromOpenAPI({\n input: inputFilePathOrURL,\n output: outputFilePath,\n serviceName,\n includeComments,\n prune,\n filters: filtersFromArguments = [],\n filterFile,\n}: OpenAPITypegenOptions) {\n const filtersFromFile = filterFile ? await readPathFiltersFromFile(filterFile) : [];\n const filters = ignoreEmptyFilters([...filtersFromFile, ...filtersFromArguments]);\n\n const rawNodes = await importTypesFromOpenAPI(inputFilePathOrURL);\n const context = createTypeTransformationContext(serviceName, filters);\n const nodes = normalizeRawNodes(rawNodes, context, { prune });\n\n const importDeclarations = createImportDeclarations(context);\n\n for (const declaration of importDeclarations) {\n nodes.unshift(declaration);\n }\n\n const typeOutput = await convertTypesToString(nodes, { includeComments });\n const formattedOutput = prepareTypeOutputToSave(typeOutput);\n\n const shouldWriteToStdout = outputFilePath === undefined;\n if (shouldWriteToStdout) {\n await writeTypeOutputToStandardOutput(formattedOutput);\n } else {\n await filesystem.writeFile(path.resolve(outputFilePath), formattedOutput);\n }\n}\n\nexport default generateTypesFromOpenAPI;\n"]}
|