ws-dottie
Version:
Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration
1 lines • 82.2 kB
Source Map (JSON)
{"version":3,"sources":["../node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs","../src/shared/zod.ts"],"names":["__rest","s","e","t","p","i","ZodTypeKeys","isZodType","schema","typeNames","typeName","_a","typeNameMatch","isAnyZodType","$ZodRegistry","_meta","meta","pm","registry","isUndefined","value","omit","object","keys","result","key","keyToOmit","omitBy","predicate","zodToOpenAPIRegistry","Metadata","metadata","currentMetadata","_internal","param","totalMetadata","inSchema","outSchema","zodSchema","initialData","unwrapped","internal","general","rest","id","title","restGeneral","preserveMetadataFromModifier","modifier","zodModifier","args","extendZodWithOpenApi","zod","refId","options","getOpenApiConfiguration","restOfOpenApi","allMetadata","_b","internalMetadata","resultMetadata","originalExtend","extendedResult","originalMeta","refOrOpenapi","metadataOrOptions","z"],"mappings":"4CAiBA,SAASA,EAAOC,CAAAA,CAAGC,CAAAA,CAAG,CAClB,IAAIC,EAAI,EAAC,CACT,IAAA,IAASC,CAAAA,IAAKH,EAAO,MAAA,CAAO,SAAA,CAAU,eAAe,IAAA,CAAKA,CAAAA,CAAGG,CAAC,CAAA,EAAKF,CAAAA,CAAE,OAAA,CAAQE,CAAC,EAAI,CAAA,GAC9ED,CAAAA,CAAEC,CAAC,CAAA,CAAIH,EAAEG,CAAC,CAAA,CAAA,CACd,GAAIH,CAAAA,EAAK,MAAQ,OAAO,MAAA,CAAO,uBAA0B,UAAA,CACrD,IAAA,IAASI,EAAI,CAAA,CAAGD,CAAAA,CAAI,MAAA,CAAO,qBAAA,CAAsBH,CAAC,CAAA,CAAGI,CAAAA,CAAID,CAAAA,CAAE,MAAA,CAAQC,IAC3DH,CAAAA,CAAE,OAAA,CAAQE,CAAAA,CAAEC,CAAC,CAAC,CAAA,CAAI,CAAA,EAAK,OAAO,SAAA,CAAU,oBAAA,CAAqB,KAAKJ,CAAAA,CAAGG,CAAAA,CAAE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e,CAAC,CAAA","file":"chunk-6REGGRVO.mjs","sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nconst ZodTypeKeys = {\n ZodAny: 'any',\n ZodArray: 'array',\n ZodBigInt: 'bigint',\n ZodBoolean: 'boolean',\n ZodDefault: 'default',\n ZodTransform: 'transform',\n ZodEnum: 'enum',\n ZodIntersection: 'intersection',\n ZodLiteral: 'literal',\n ZodNever: 'never',\n ZodNull: 'null',\n ZodNullable: 'nullable',\n ZodNumber: 'number',\n ZodNonOptional: 'nonoptional',\n ZodObject: 'object',\n ZodOptional: 'optional',\n ZodPipe: 'pipe',\n ZodReadonly: 'readonly',\n ZodRecord: 'record',\n ZodString: 'string',\n ZodTuple: 'tuple',\n ZodType: 'type',\n ZodUnion: 'union',\n ZodDiscriminatedUnion: 'union',\n ZodUnknown: 'unknown',\n ZodVoid: 'void',\n ZodDate: 'date',\n};\nfunction isZodType(schema, typeNames) {\n const typeNamesArray = Array.isArray(typeNames) ? typeNames : [typeNames];\n return typeNamesArray.some(typeName => {\n var _a;\n const typeNameMatch = ((_a = schema === null || schema === void 0 ? void 0 : schema.def) === null || _a === void 0 ? void 0 : _a.type) === ZodTypeKeys[typeName];\n if (typeName === 'ZodDiscriminatedUnion') {\n return (typeNameMatch &&\n 'discriminator' in schema.def);\n }\n return typeNameMatch;\n });\n}\nfunction isAnyZodType(schema) {\n return 'def' in schema;\n}\n/**\n * The schema.isNullable() is deprecated. This is the suggested replacement\n * as this was how isNullable operated beforehand.\n */\nfunction isNullableSchema(schema) {\n return schema.safeParse(null).success;\n}\n/**\n * The schema.isOptional() is deprecated. This is the suggested replacement\n * as this was how isOptional operated beforehand.\n */\nfunction isOptionalSchema(schema) {\n return schema.safeParse(undefined).success;\n}\n\nclass $ZodRegistry {\n constructor() {\n this._map = new Map();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n if (this._idmap.has(meta.id)) {\n throw new Error(`ID ${meta.id} already exists in the registry`);\n }\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new Map();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n return { ...pm, ...this._map.get(schema) };\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nfunction registry() {\n return new $ZodRegistry();\n}\n\nfunction isEqual(x, y) {\n if (x === null || x === undefined || y === null || y === undefined) {\n return x === y;\n }\n if (x === y || x.valueOf() === y.valueOf()) {\n return true;\n }\n if (Array.isArray(x)) {\n if (!Array.isArray(y)) {\n return false;\n }\n if (x.length !== y.length) {\n return false;\n }\n }\n // if they are strictly equal, they both need to be object at least\n if (!(x instanceof Object) || !(y instanceof Object)) {\n return false;\n }\n // recursive object equality check\n const keysX = Object.keys(x);\n return (Object.keys(y).every(keyY => keysX.indexOf(keyY) !== -1) &&\n keysX.every(key => isEqual(x[key], y[key])));\n}\nclass ObjectSet {\n constructor() {\n this.buckets = new Map();\n }\n put(value) {\n const hashCode = this.hashCodeOf(value);\n const itemsByCode = this.buckets.get(hashCode);\n if (!itemsByCode) {\n this.buckets.set(hashCode, [value]);\n return;\n }\n const alreadyHasItem = itemsByCode.some(_ => isEqual(_, value));\n if (!alreadyHasItem) {\n itemsByCode.push(value);\n }\n }\n contains(value) {\n const hashCode = this.hashCodeOf(value);\n const itemsByCode = this.buckets.get(hashCode);\n if (!itemsByCode) {\n return false;\n }\n return itemsByCode.some(_ => isEqual(_, value));\n }\n values() {\n return [...this.buckets.values()].flat();\n }\n stats() {\n let totalBuckets = 0;\n let totalValues = 0;\n let collisions = 0;\n for (const bucket of this.buckets.values()) {\n totalBuckets += 1;\n totalValues += bucket.length;\n if (bucket.length > 1) {\n collisions += 1;\n }\n }\n const hashEffectiveness = totalBuckets / totalValues;\n return { totalBuckets, collisions, totalValues, hashEffectiveness };\n }\n hashCodeOf(object) {\n let hashCode = 0;\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; i++) {\n hashCode ^= this.hashCodeOf(object[i]) * i;\n }\n return hashCode;\n }\n if (typeof object === 'string') {\n for (let i = 0; i < object.length; i++) {\n hashCode ^= object.charCodeAt(i) * i;\n }\n return hashCode;\n }\n if (typeof object === 'number') {\n return object;\n }\n if (typeof object === 'object') {\n for (const [key, value] of Object.entries(object)) {\n hashCode ^= this.hashCodeOf(key) + this.hashCodeOf(value !== null && value !== void 0 ? value : '');\n }\n }\n return hashCode;\n }\n}\n\nfunction isUndefined(value) {\n return value === undefined;\n}\nfunction mapValues(object, mapper) {\n const result = {};\n Object.entries(object).forEach(([key, value]) => {\n result[key] = mapper(value);\n });\n return result;\n}\nfunction omit(object, keys) {\n const result = {};\n Object.entries(object).forEach(([key, value]) => {\n if (!keys.some(keyToOmit => keyToOmit === key)) {\n result[key] = value;\n }\n });\n return result;\n}\nfunction omitBy(object, predicate) {\n const result = {};\n Object.entries(object).forEach(([key, value]) => {\n if (!predicate(value, key)) {\n result[key] = value;\n }\n });\n return result;\n}\nfunction compact(arr) {\n return arr.filter((elem) => !isUndefined(elem));\n}\nconst objectEquals = isEqual;\nfunction uniq(values) {\n const set = new ObjectSet();\n values.forEach(value => set.put(value));\n return [...set.values()];\n}\nfunction isString(val) {\n return typeof val === 'string';\n}\nfunction sortObjectByKeys(obj) {\n return Object.fromEntries(Object.entries(obj).sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey)));\n}\n\n/**\n * @deprecated This is not really deprecated but this should always be used with\n * caution. Using it may alter the behavior of the library and the generated schemas.\n */\nconst zodToOpenAPIRegistry = registry();\nclass Metadata {\n static collectMetadata(schema, metadata) {\n const currentMetadata = this.getMetadataFromRegistry(schema);\n const _internal = Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata._internal), metadata === null || metadata === void 0 ? void 0 : metadata._internal);\n const param = Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param), metadata === null || metadata === void 0 ? void 0 : metadata.param);\n const totalMetadata = Object.assign(Object.assign(Object.assign(Object.assign({}, (Object.keys(_internal).length > 0 ? { _internal } : {})), currentMetadata), metadata), (Object.keys(param).length > 0 ? { param } : {}));\n if (isZodType(schema, [\n 'ZodOptional',\n 'ZodNullable',\n 'ZodDefault',\n 'ZodReadonly',\n 'ZodNonOptional',\n ]) &&\n isAnyZodType(schema._zod.def.innerType)) {\n return this.collectMetadata(schema._zod.def.innerType, totalMetadata);\n }\n if (isZodType(schema, 'ZodPipe')) {\n const inSchema = schema._zod.def.in;\n const outSchema = schema._zod.def.out;\n // meaning preprocess\n if (isZodType(inSchema, 'ZodTransform') && isAnyZodType(outSchema)) {\n return this.collectMetadata(outSchema, totalMetadata);\n }\n if (isAnyZodType(inSchema)) {\n // meaning transform\n return this.collectMetadata(inSchema, totalMetadata);\n }\n }\n return totalMetadata;\n }\n /**\n * @deprecated Use one of `getOpenApiMetadata` or `getInternalMetadata` instead\n */\n static getMetadata(zodSchema) {\n return this.collectMetadata(zodSchema);\n }\n static getOpenApiMetadata(zodSchema) {\n const metadata = this.collectMetadata(zodSchema);\n const _a = metadata !== null && metadata !== void 0 ? metadata : {}, rest = __rest(_a, [\"_internal\"]);\n return rest;\n }\n static getInternalMetadata(zodSchema) {\n var _a;\n return (_a = this.collectMetadata(zodSchema)) === null || _a === void 0 ? void 0 : _a._internal;\n }\n static getParamMetadata(zodSchema) {\n const metadata = this.collectMetadata(zodSchema);\n return Object.assign(Object.assign({}, metadata), { \n // A description provided from .openapi() should be taken with higher precedence\n param: Object.assign(Object.assign({}, ((metadata === null || metadata === void 0 ? void 0 : metadata.description) ? { description: metadata.description } : {})), metadata === null || metadata === void 0 ? void 0 : metadata.param) });\n }\n /**\n * A method that omits all custom keys added to the regular OpenAPI\n * metadata properties\n */\n static buildSchemaMetadata(metadata) {\n return omitBy(omit(metadata, ['param', '_internal']), isUndefined);\n }\n static buildParameterMetadata(metadata) {\n return omitBy(metadata, isUndefined);\n }\n static applySchemaMetadata(initialData, metadata) {\n return omitBy(Object.assign(Object.assign({}, initialData), this.buildSchemaMetadata(metadata)), isUndefined);\n }\n static getRefId(zodSchema) {\n var _a;\n return (_a = this.getInternalMetadata(zodSchema)) === null || _a === void 0 ? void 0 : _a.refId;\n }\n static unwrapChained(schema) {\n return this.unwrapUntil(schema);\n }\n static getDefaultValue(zodSchema) {\n const unwrapped = this.unwrapUntil(zodSchema, 'ZodDefault');\n return unwrapped === null || unwrapped === void 0 ? void 0 : unwrapped._zod.def.defaultValue;\n }\n static unwrapUntil(schema, typeName) {\n if (typeName && isZodType(schema, typeName)) {\n return schema;\n }\n if (isZodType(schema, [\n 'ZodOptional',\n 'ZodNullable',\n 'ZodDefault',\n 'ZodReadonly',\n 'ZodNonOptional',\n ]) &&\n isAnyZodType(schema._zod.def.innerType)) {\n return this.unwrapUntil(schema._zod.def.innerType, typeName);\n }\n if (isZodType(schema, 'ZodPipe')) {\n const inSchema = schema._zod.def.in;\n const outSchema = schema._zod.def.out;\n // meaning preprocess\n if (isZodType(inSchema, 'ZodTransform') && isAnyZodType(outSchema)) {\n return this.unwrapUntil(outSchema, typeName);\n }\n // meaning transform\n if (isAnyZodType(inSchema)) {\n return this.unwrapUntil(inSchema, typeName);\n }\n }\n return typeName ? undefined : schema;\n }\n static getMetadataFromInternalRegistry(zodSchema) {\n return zodToOpenAPIRegistry.get(zodSchema);\n }\n static getMetadataFromRegistry(zodSchema) {\n const internal = this.getMetadataFromInternalRegistry(zodSchema);\n const general = zodSchema.meta();\n if (!internal) {\n return general;\n }\n const { _internal } = internal, rest = __rest(internal, [\"_internal\"]);\n const _a = general !== null && general !== void 0 ? general : {}, { id, title } = _a, restGeneral = __rest(_a, [\"id\", \"title\"]);\n return Object.assign(Object.assign(Object.assign({ _internal: Object.assign(Object.assign({}, (id ? { refId: id } : {})), _internal) }, rest), (title ? { description: title } : {})), restGeneral);\n }\n static setMetadataInRegistry(zodSchema, metadata) {\n zodToOpenAPIRegistry.add(zodSchema, metadata);\n }\n}\n\nfunction preserveMetadataFromModifier(zodSchema, modifier) {\n const zodModifier = zodSchema[modifier];\n if (typeof zodModifier !== 'function') {\n return;\n }\n zodSchema[modifier] = function (...args) {\n const result = zodModifier.apply(this, args);\n const meta = Metadata.getMetadataFromRegistry(this);\n if (meta) {\n Metadata.setMetadataInRegistry(result, meta);\n }\n return result;\n };\n}\nfunction extendZodWithOpenApi(zod) {\n if (typeof zod.ZodType.prototype.openapi !== 'undefined') {\n // This zod instance is already extended with the required methods,\n // doing it again will just result in multiple wrapper methods for\n // `optional` and `nullable`\n return;\n }\n zod.ZodType.prototype.openapi = function (...args) {\n const { refId, metadata, options } = getOpenApiConfiguration(...args);\n const _a = metadata !== null && metadata !== void 0 ? metadata : {}, { param } = _a, restOfOpenApi = __rest(_a, [\"param\"]);\n const allMetadata = Metadata.getMetadataFromRegistry(this);\n const _b = allMetadata !== null && allMetadata !== void 0 ? allMetadata : {}, { _internal: internalMetadata } = _b, currentMetadata = __rest(_b, [\"_internal\"]);\n const _internal = Object.assign(Object.assign(Object.assign({}, internalMetadata), options), (refId ? { refId } : undefined));\n const resultMetadata = Object.assign(Object.assign(Object.assign({}, currentMetadata), restOfOpenApi), ((currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param) || param\n ? {\n param: Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param), param),\n }\n : undefined));\n // We need to create a new instance of the schema so that sequential\n // calls to .openapi from keys do not override each other\n // See the test in metadata-overrides.spec.ts (only adds overrides for new metadata properties)\n const result = new this.constructor(this._def);\n Metadata.setMetadataInRegistry(result, Object.assign(Object.assign({}, (Object.keys(_internal).length > 0 ? { _internal } : undefined)), resultMetadata));\n if (isZodType(result, 'ZodObject')) {\n const currentMetadata = Metadata.getMetadataFromRegistry(result);\n const originalExtend = result.extend;\n result.extend = function (...args) {\n const extendedResult = originalExtend.apply(result, args);\n const _a = currentMetadata !== null && currentMetadata !== void 0 ? currentMetadata : {}, { _internal } = _a, rest = __rest(_a, [\"_internal\"]);\n Metadata.setMetadataInRegistry(extendedResult, {\n _internal: {\n extendedFrom: (_internal === null || _internal === void 0 ? void 0 : _internal.refId)\n ? { refId: _internal.refId, schema: result }\n : _internal === null || _internal === void 0 ? void 0 : _internal.extendedFrom,\n },\n });\n // This is hacky. Yes we can do that directly in the meta call above,\n // but that would not override future calls to .extend. That's why\n // we call openapi explicitly here. And in that case might as well add the metadata\n // here instead of through the meta call\n return extendedResult.openapi(rest);\n };\n preserveMetadataFromModifier(result, 'catchall');\n }\n preserveMetadataFromModifier(result, 'optional');\n preserveMetadataFromModifier(result, 'nullable');\n preserveMetadataFromModifier(result, 'default');\n preserveMetadataFromModifier(result, 'transform');\n preserveMetadataFromModifier(result, 'refine');\n preserveMetadataFromModifier(result, 'length');\n preserveMetadataFromModifier(result, 'min');\n preserveMetadataFromModifier(result, 'max');\n const originalMeta = result.meta;\n result.meta = function (...args) {\n const result = originalMeta.apply(this, args);\n if (args[0]) {\n const meta = Metadata.getMetadataFromInternalRegistry(this);\n if (meta) {\n Metadata.setMetadataInRegistry(result, Object.assign(Object.assign({}, meta), args[0]));\n }\n }\n return result;\n };\n return result;\n };\n}\nfunction getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {\n if (typeof refOrOpenapi === 'string') {\n return {\n refId: refOrOpenapi,\n metadata: metadataOrOptions,\n options,\n };\n }\n return {\n refId: undefined,\n metadata: refOrOpenapi,\n options: metadataOrOptions,\n };\n}\n\nfunction getOpenApiMetadata(zodSchema) {\n var _a;\n return omitBy((_a = Metadata.getOpenApiMetadata(zodSchema)) !== null && _a !== void 0 ? _a : {}, isUndefined);\n}\nfunction getRefId(zodSchema) {\n return Metadata.getRefId(zodSchema);\n}\n\nclass OpenAPIRegistry {\n constructor(parents) {\n this.parents = parents;\n this._definitions = [];\n }\n get definitions() {\n var _a, _b;\n const parentDefinitions = (_b = (_a = this.parents) === null || _a === void 0 ? void 0 : _a.flatMap(par => par._definitions)) !== null && _b !== void 0 ? _b : [];\n return [...parentDefinitions, ...this._definitions];\n }\n /**\n * Registers a new component schema under /components/schemas/${name}\n */\n register(refId, zodSchema) {\n const schemaWithRefId = this.schemaWithRefId(refId, zodSchema);\n this._definitions.push({ type: 'schema', schema: schemaWithRefId });\n return schemaWithRefId;\n }\n /**\n * Registers a new parameter schema under /components/parameters/${name}\n */\n registerParameter(refId, zodSchema) {\n var _a, _b, _c;\n const schemaWithRefId = this.schemaWithRefId(refId, zodSchema);\n const currentMetadata = (_a = Metadata.getOpenApiMetadata(schemaWithRefId)) !== null && _a !== void 0 ? _a : {};\n const schemaWithMetadata = schemaWithRefId.openapi(Object.assign(Object.assign({}, currentMetadata), { param: Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param), { name: (_c = (_b = currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : refId }) }));\n this._definitions.push({\n type: 'parameter',\n schema: schemaWithMetadata,\n });\n return schemaWithMetadata;\n }\n /**\n * Registers a new path that would be generated under paths:\n */\n registerPath(route) {\n this._definitions.push({\n type: 'route',\n route,\n });\n }\n /**\n * Registers a new webhook that would be generated under webhooks:\n */\n registerWebhook(webhook) {\n this._definitions.push({\n type: 'webhook',\n webhook,\n });\n }\n /**\n * Registers a raw OpenAPI component. Use this if you have a simple object instead of a Zod schema.\n *\n * @param type The component type, e.g. `schemas`, `responses`, `securitySchemes`, etc.\n * @param name The name of the object, it is the key under the component\n * type in the resulting OpenAPI document\n * @param component The actual object to put there\n */\n registerComponent(type, name, component) {\n this._definitions.push({\n type: 'component',\n componentType: type,\n name,\n component,\n });\n return {\n name,\n ref: { $ref: `#/components/${type}/${name}` },\n };\n }\n schemaWithRefId(refId, zodSchema) {\n return zodSchema.openapi(refId);\n }\n}\n\nclass ZodToOpenAPIError {\n constructor(message) {\n this.message = message;\n }\n}\nclass ConflictError extends ZodToOpenAPIError {\n constructor(message, data) {\n super(message);\n this.data = data;\n }\n}\nclass MissingParameterDataError extends ZodToOpenAPIError {\n constructor(data) {\n super(`Missing parameter data, please specify \\`${data.missingField}\\` and other OpenAPI parameter props using the \\`param\\` field of \\`schema.openapi\\``);\n this.data = data;\n }\n}\nfunction enhanceMissingParametersError(action, paramsToAdd) {\n try {\n return action();\n }\n catch (error) {\n if (error instanceof MissingParameterDataError) {\n throw new MissingParameterDataError(Object.assign(Object.assign({}, error.data), paramsToAdd));\n }\n throw error;\n }\n}\nclass UnknownZodTypeError extends ZodToOpenAPIError {\n constructor(data) {\n super(`Unknown zod object type, please specify \\`type\\` and other OpenAPI props using \\`schema.openapi\\`.`);\n this.data = data;\n }\n}\n\nclass ArrayTransformer {\n transform(zodSchema, mapNullableType, mapItems) {\n var _a, _b, _c, _d;\n const itemType = zodSchema.def.element;\n const minItems = (_b = (_a = zodSchema.def.checks) === null || _a === void 0 ? void 0 : _a.find((check) => check._zod.def.check === 'min_length')) === null || _b === void 0 ? void 0 : _b._zod.def.minimum;\n const maxItems = (_d = (_c = zodSchema.def.checks) === null || _c === void 0 ? void 0 : _c.find((check) => check._zod.def.check === 'max_length')) === null || _d === void 0 ? void 0 : _d._zod.def.maximum;\n return Object.assign(Object.assign({}, mapNullableType('array')), { items: isAnyZodType(itemType) ? mapItems(itemType) : {}, minItems,\n maxItems });\n }\n}\n\nclass BigIntTransformer {\n transform(mapNullableType) {\n return Object.assign(Object.assign({}, mapNullableType('string')), { pattern: `^\\d+$` });\n }\n}\n\nclass DiscriminatedUnionTransformer {\n transform(zodSchema, isNullable, mapNullableOfArray, mapItem, generateSchemaRef) {\n const options = [...zodSchema.def.options];\n const optionSchema = options.map(mapItem);\n if (isNullable) {\n return {\n oneOf: mapNullableOfArray(optionSchema, isNullable),\n };\n }\n const discriminator = zodSchema._zod.def.discriminator;\n if (!discriminator) {\n console.error('No discriminator found for discriminated union', zodSchema);\n return {\n oneOf: optionSchema,\n };\n }\n return {\n oneOf: optionSchema,\n discriminator: this.mapDiscriminator(options, discriminator, generateSchemaRef),\n };\n }\n mapDiscriminator(zodObjects, discriminator, generateSchemaRef) {\n // All schemas must be registered to use a discriminator\n if (zodObjects.some(obj => Metadata.getRefId(obj) === undefined)) {\n return undefined;\n }\n const mapping = {};\n zodObjects.forEach(obj => {\n var _a;\n const refId = Metadata.getRefId(obj); // type-checked earlier\n const value = (_a = obj.def.shape) === null || _a === void 0 ? void 0 : _a[discriminator];\n if (isZodType(value, 'ZodEnum')) {\n // Native enums have their keys as both number and strings however the number is an\n // internal representation and the string is the access point for a documentation\n const keys = Object.values(value._zod.def.entries).filter(isString);\n keys.forEach((enumValue) => {\n mapping[enumValue] = generateSchemaRef(refId);\n });\n return;\n }\n const literalValue = value === null || value === void 0 ? void 0 : value.def.values[0];\n // This should never happen because Zod checks the disciminator type but to keep the types happy\n if (typeof literalValue !== 'string') {\n throw new Error(`Discriminator ${discriminator} could not be found in one of the values of a discriminated union`);\n }\n mapping[literalValue] = generateSchemaRef(refId);\n });\n return {\n propertyName: discriminator,\n mapping,\n };\n }\n}\n\n/**\n * Numeric enums have a reverse mapping https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings\n * whereas string ones don't.\n *\n * This function checks if an enum is fully numeric - i.e all values are numbers or not.\n * And filters out only the actual enum values when a reverse mapping is apparent.\n */\nfunction enumInfo(enumObject) {\n const keysExceptReverseMappings = Object.keys(enumObject).filter(key => typeof enumObject[enumObject[key]] !== 'number');\n const values = keysExceptReverseMappings.map(key => enumObject[key]);\n const numericCount = values.filter(_ => typeof _ === 'number').length;\n const type = numericCount === 0\n ? 'string'\n : numericCount === values.length\n ? 'numeric'\n : 'mixed';\n return { values, type };\n}\n\nclass EnumTransformer {\n transform(zodSchema, mapNullableType) {\n const { type, values } = enumInfo(zodSchema._zod.def.entries);\n if (type === 'mixed') {\n // enum Test {\n // A = 42,\n // B = 'test',\n // }\n //\n // const result = z.nativeEnum(Test).parse('42');\n //\n // This is an error, so we can't just say it's a 'string'\n throw new ZodToOpenAPIError('Enum has mixed string and number values, please specify the OpenAPI type manually');\n }\n return Object.assign(Object.assign({}, mapNullableType(type === 'numeric' ? 'integer' : 'string')), { enum: values });\n }\n}\n\nclass IntersectionTransformer {\n transform(zodSchema, isNullable, mapNullableOfArray, mapItem) {\n const subtypes = this.flattenIntersectionTypes(zodSchema);\n const allOfSchema = {\n allOf: subtypes.map(mapItem),\n };\n if (isNullable) {\n return {\n anyOf: mapNullableOfArray([allOfSchema], isNullable),\n };\n }\n return allOfSchema;\n }\n flattenIntersectionTypes(schema) {\n if (!isZodType(schema, 'ZodIntersection')) {\n return [schema];\n }\n const leftSubTypes = isAnyZodType(schema._zod.def.left)\n ? this.flattenIntersectionTypes(schema._zod.def.left)\n : [];\n const rightSubTypes = isAnyZodType(schema._zod.def.right)\n ? this.flattenIntersectionTypes(schema._zod.def.right)\n : [];\n return [...leftSubTypes, ...rightSubTypes];\n }\n}\n\nclass LiteralTransformer {\n constructor() {\n this.bigIntTransformer = new BigIntTransformer();\n }\n transform(zodSchema, mapNullableType) {\n const type = typeof zodSchema.def.values[0];\n if (type === 'boolean' ||\n type === 'number' ||\n type === 'string' ||\n type === 'object') {\n return Object.assign(Object.assign({}, mapNullableType(type)), { enum: [zodSchema.def.values[0]] });\n }\n if (type === 'bigint') {\n return this.bigIntTransformer.transform(mapNullableType);\n }\n // Zod doesn't really support anything else anyways\n return mapNullableType('null');\n }\n}\n\nclass NumberTransformer {\n transform(zodSchema, mapNullableType, getNumberChecks) {\n var _a;\n return Object.assign(Object.assign(Object.assign({}, mapNullableType('number')), mapNullableType(zodSchema.format === 'safeint' ? 'integer' : 'number')), getNumberChecks((_a = zodSchema.def.checks) !== null && _a !== void 0 ? _a : []));\n }\n}\n\nclass ObjectTransformer {\n transform(zodSchema, defaultValue, mapNullableType, mapItem) {\n var _a;\n const extendedFrom = (_a = Metadata.getInternalMetadata(zodSchema)) === null || _a === void 0 ? void 0 : _a.extendedFrom;\n const required = this.requiredKeysOf(zodSchema);\n const properties = mapValues(zodSchema.def.shape, mapItem);\n if (!extendedFrom) {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, mapNullableType('object')), { properties, default: defaultValue }), (required.length > 0 ? { required } : {})), this.generateAdditionalProperties(zodSchema, mapItem));\n }\n const parent = extendedFrom.schema;\n // We want to generate the parent schema so that it can be referenced down the line\n mapItem(parent);\n const keysRequiredByParent = this.requiredKeysOf(parent);\n const propsOfParent = mapValues(parent === null || parent === void 0 ? void 0 : parent.def.shape, mapItem);\n const propertiesToAdd = Object.fromEntries(Object.entries(properties).filter(([key, type]) => {\n return !objectEquals(propsOfParent[key], type);\n }));\n const additionallyRequired = required.filter(prop => !keysRequiredByParent.includes(prop));\n const objectData = Object.assign(Object.assign(Object.assign(Object.assign({}, mapNullableType('object')), { default: defaultValue, properties: propertiesToAdd }), (additionallyRequired.length > 0\n ? { required: additionallyRequired }\n : {})), this.generateAdditionalProperties(zodSchema, mapItem));\n return {\n allOf: [\n { $ref: `#/components/schemas/${extendedFrom.refId}` },\n objectData,\n ],\n };\n }\n generateAdditionalProperties(zodSchema, mapItem) {\n const catchallSchema = zodSchema.def.catchall;\n if (!catchallSchema) {\n return {};\n }\n if (isZodType(catchallSchema, 'ZodNever')) {\n return { additionalProperties: false };\n }\n if (isAnyZodType(catchallSchema)) {\n return { additionalProperties: mapItem(catchallSchema) };\n }\n return {};\n }\n requiredKeysOf(objectSchema) {\n return Object.entries(objectSchema.def.shape)\n .filter(([_key, type]) => !isOptionalSchema(type))\n .map(([key, _type]) => key);\n }\n}\n\nclass RecordTransformer {\n transform(zodSchema, mapNullableType, mapItem) {\n const propertiesType = zodSchema.valueType;\n const keyType = zodSchema.keyType;\n const propertiesSchema = isAnyZodType(propertiesType)\n ? mapItem(propertiesType)\n : {};\n if (isZodType(keyType, 'ZodEnum')) {\n // Native enums have their keys as both number and strings however the number is an\n // internal representation and the string is the access point for a documentation\n const keys = Object.values(keyType._zod.def.entries).filter(isString);\n const properties = keys.reduce((acc, curr) => (Object.assign(Object.assign({}, acc), { [curr]: propertiesSchema })), {});\n return Object.assign(Object.assign({}, mapNullableType('object')), { properties });\n }\n return Object.assign(Object.assign({}, mapNullableType('object')), { additionalProperties: propertiesSchema });\n }\n}\n\nfunction isZodCheckLengthEquals(check) {\n return check._zod.def.check === 'length_equals';\n}\nfunction isZodCheckRegex(check) {\n return (check._zod.def.check === 'string_format' &&\n check._zod.def.format === 'regex');\n}\nclass StringTransformer {\n transform(zodSchema, mapNullableType) {\n var _a, _b, _c, _d;\n const regexCheck = (_a = zodSchema.def.checks) === null || _a === void 0 ? void 0 : _a.find(isZodCheckRegex);\n // toString generates an additional / at the beginning and end of the pattern\n const pattern = regexCheck === null || regexCheck === void 0 ? void 0 : regexCheck._zod.def.pattern.toString().replace(/^\\/|\\/$/g, '');\n const check = (_b = zodSchema.def.checks) === null || _b === void 0 ? void 0 : _b.find(isZodCheckLengthEquals);\n const length = check === null || check === void 0 ? void 0 : check._zod.def.length;\n const maxLength = Number.isFinite(zodSchema.minLength)\n ? (_c = zodSchema.minLength) !== null && _c !== void 0 ? _c : undefined\n : undefined;\n const minLength = Number.isFinite(zodSchema.maxLength)\n ? (_d = zodSchema.maxLength) !== null && _d !== void 0 ? _d : undefined\n : undefined;\n return Object.assign(Object.assign({}, mapNullableType('string')), { \n // FIXME: https://github.com/colinhacks/zod/commit/d78047e9f44596a96d637abb0ce209cd2732d88c\n minLength: length !== null && length !== void 0 ? length : maxLength, maxLength: length !== null && length !== void 0 ? length : minLength, format: this.mapStringFormat(zodSchema), pattern });\n }\n /**\n * Attempts to map Zod strings to known formats\n * https://json-schema.org/understanding-json-schema/reference/string.html#built-in-formats\n */\n mapStringFormat(zodString) {\n if (zodString.format === 'uuid')\n return 'uuid';\n if (zodString.format === 'email')\n return 'email';\n if (zodString.format === 'url')\n return 'uri';\n if (zodString.format === 'date')\n return 'date';\n if (zodString.format === 'datetime')\n return 'date-time';\n if (zodString.format === 'cuid')\n return 'cuid';\n if (zodString.format === 'cuid2')\n return 'cuid2';\n if (zodString.format === 'ulid')\n return 'ulid';\n if (zodString.format === 'ipv4')\n return 'ip';\n if (zodString.format === 'ipv6')\n return 'ip';\n if (zodString.format === 'emoji')\n return 'emoji';\n return undefined;\n }\n}\n\nclass TupleTransformer {\n constructor(versionSpecifics) {\n this.versionSpecifics = versionSpecifics;\n }\n transform(zodSchema, mapNullableType, mapItem) {\n const items = zodSchema._zod.def.items;\n const schemas = items.map(item => isAnyZodType(item) ? mapItem(item) : {});\n return Object.assign(Object.assign({}, mapNullableType('array')), this.versionSpecifics.mapTupleItems(schemas));\n }\n}\n\nclass UnionTransformer {\n constructor(options) {\n this.options = options;\n }\n transform(zodSchema, mapNullableOfArray, mapItem) {\n var _a, _b, _c;\n cons