@kubb/plugin-oas 2.25.0 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{OperationGenerator-DO5tNGuT.d.ts → OperationGenerator-B0RLFu4P.d.ts} +1 -1
  2. package/dist/{OperationGenerator-BV6QRtkW.d.cts → OperationGenerator-CrCcKl3S.d.cts} +1 -1
  3. package/dist/{Schema-D41ItX9C.d.ts → Schema-DefwBJMc.d.ts} +3 -1
  4. package/dist/{Schema-FGI5VPqc.d.cts → Schema-an5hOrjZ.d.cts} +3 -1
  5. package/dist/{chunk-CO7DS2KL.cjs → chunk-3UN2S6P2.cjs} +3 -3
  6. package/dist/{chunk-CO7DS2KL.cjs.map → chunk-3UN2S6P2.cjs.map} +1 -1
  7. package/dist/{chunk-EK7UO5ZW.js → chunk-GUPCIAYT.js} +2 -2
  8. package/dist/{chunk-PFN2GSIC.cjs → chunk-J7IF3KA3.cjs} +3 -3
  9. package/dist/{chunk-PFN2GSIC.cjs.map → chunk-J7IF3KA3.cjs.map} +1 -1
  10. package/dist/{chunk-CCPZYOTX.cjs → chunk-K4GEQ3C2.cjs} +24 -21
  11. package/dist/chunk-K4GEQ3C2.cjs.map +1 -0
  12. package/dist/{chunk-KI3GNEKH.js → chunk-QSM6A5QX.js} +5 -5
  13. package/dist/{chunk-KI3GNEKH.js.map → chunk-QSM6A5QX.js.map} +1 -1
  14. package/dist/{chunk-TL7TBM2U.cjs → chunk-UKUEVTRB.cjs} +25 -25
  15. package/dist/{chunk-TL7TBM2U.cjs.map → chunk-UKUEVTRB.cjs.map} +1 -1
  16. package/dist/{chunk-LRJFQCDO.js → chunk-Y272OQMW.js} +3 -3
  17. package/dist/{chunk-LRJFQCDO.js.map → chunk-Y272OQMW.js.map} +1 -1
  18. package/dist/{chunk-UZLE6NIY.js → chunk-ZZ7ZC4TT.js} +5 -2
  19. package/dist/chunk-ZZ7ZC4TT.js.map +1 -0
  20. package/dist/components.cjs +5 -5
  21. package/dist/components.d.cts +4 -4
  22. package/dist/components.d.ts +4 -4
  23. package/dist/components.js +3 -3
  24. package/dist/hooks.cjs +13 -13
  25. package/dist/hooks.d.cts +2 -2
  26. package/dist/hooks.d.ts +2 -2
  27. package/dist/hooks.js +3 -3
  28. package/dist/index.cjs +20 -20
  29. package/dist/index.d.cts +3 -3
  30. package/dist/index.d.ts +3 -3
  31. package/dist/index.js +3 -3
  32. package/dist/{types-Db0qp8u-.d.ts → types-BP45TdiW.d.cts} +1 -1
  33. package/dist/{types-Db0qp8u-.d.cts → types-BP45TdiW.d.ts} +1 -1
  34. package/dist/utils.cjs +8 -8
  35. package/dist/utils.d.cts +2 -2
  36. package/dist/utils.d.ts +2 -2
  37. package/dist/utils.js +2 -2
  38. package/package.json +12 -12
  39. package/src/SchemaGenerator.ts +5 -1
  40. package/src/components/Schema.tsx +5 -2
  41. package/src/types.ts +1 -1
  42. package/dist/chunk-CCPZYOTX.cjs.map +0 -1
  43. package/dist/chunk-UZLE6NIY.js.map +0 -1
  44. /package/dist/{chunk-EK7UO5ZW.js.map → chunk-GUPCIAYT.js.map} +0 -0
@@ -35,9 +35,9 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
35
35
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
36
36
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
37
37
 
38
- // ../../node_modules/.pnpm/tsup@8.2.3_@microsoft+api-extractor@7.47.4_@types+node@20.14.13__jiti@1.21.6_postcss@8.4.39_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js
38
+ // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.5_@types+node@20.14.15__jiti@1.21.6_postcss@8.4.40_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js
39
39
  var init_esm_shims = __esm({
40
- "../../node_modules/.pnpm/tsup@8.2.3_@microsoft+api-extractor@7.47.4_@types+node@20.14.13__jiti@1.21.6_postcss@8.4.39_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js"() {
40
+ "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.5_@types+node@20.14.15__jiti@1.21.6_postcss@8.4.40_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js"() {
41
41
  "use strict";
42
42
  }
43
43
  });
@@ -98,4 +98,4 @@ export {
98
98
  getSchemas,
99
99
  getSchemaFactory
100
100
  };
101
- //# sourceMappingURL=chunk-LRJFQCDO.js.map
101
+ //# sourceMappingURL=chunk-Y272OQMW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.2.3_@microsoft+api-extractor@7.47.4_@types+node@20.14.13__jiti@1.21.6_postcss@8.4.39_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js","../src/utils/getSchemas.ts","../src/utils/getSchemaFactory.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import type { Oas, OasTypes, contentType } from '@kubb/oas'\n\ntype Mode = 'schemas' | 'responses' | 'requestBodies'\n\nexport type GetSchemasProps = {\n oas: Oas\n contentType?: contentType\n includes?: Mode[]\n}\n\nexport function getSchemas({ oas, contentType, includes = ['schemas', 'requestBodies', 'responses'] }: GetSchemasProps): Record<string, OasTypes.SchemaObject> {\n const components = oas.getDefinition().components\n\n let schemas: Record<string, OasTypes.SchemaObject> = {}\n\n if (includes.includes('schemas')) {\n schemas = {\n ...schemas,\n ...((components?.schemas as Record<string, OasTypes.SchemaObject>) || {}),\n }\n }\n\n const requestBodies = components?.requestBodies || {}\n if (includes.includes('responses')) {\n const responses = components?.responses || {}\n\n Object.entries(responses).forEach(([name, response]: [string, OasTypes.ResponseObject]) => {\n if (response.content && !schemas[name]) {\n const firstContentType = Object.keys(response.content)[0] || 'application/json'\n schemas[name] = response.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n if (includes.includes('requestBodies')) {\n Object.entries(requestBodies).forEach(([name, request]: [string, OasTypes.RequestBodyObject]) => {\n if (request.content && !schemas[name]) {\n const firstContentType = Object.keys(request.content)[0] || 'application/json'\n schemas[name] = request.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n return schemas\n}\n","import { isOpenApiV3_1Document } from '@kubb/oas'\n\nimport type { Oas, OpenAPIV3, OpenAPIV3_1, SchemaObject } from '@kubb/oas'\n\n/**\n * Make it possible to narrow down the schema based on a specific version(3 or 3.1)\n */\ntype SchemaResult<TWithRef extends boolean = false> =\n | {\n schema?: (TWithRef extends true ? OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject : OpenAPIV3.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.0'\n }\n | {\n schema?: (TWithRef extends true ? OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject : OpenAPIV3_1.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.1'\n }\n\nexport function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (schema?: SchemaObject) => SchemaResult<TWithRef> {\n return (schema?: SchemaObject) => {\n const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'\n\n return {\n schema,\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAUO,SAAS,WAAW,EAAE,KAAK,aAAa,WAAW,CAAC,WAAW,iBAAiB,WAAW,EAAE,GA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postcss@8.4.40_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js","../src/utils/getSchemas.ts","../src/utils/getSchemaFactory.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import type { Oas, OasTypes, contentType } from '@kubb/oas'\n\ntype Mode = 'schemas' | 'responses' | 'requestBodies'\n\nexport type GetSchemasProps = {\n oas: Oas\n contentType?: contentType\n includes?: Mode[]\n}\n\nexport function getSchemas({ oas, contentType, includes = ['schemas', 'requestBodies', 'responses'] }: GetSchemasProps): Record<string, OasTypes.SchemaObject> {\n const components = oas.getDefinition().components\n\n let schemas: Record<string, OasTypes.SchemaObject> = {}\n\n if (includes.includes('schemas')) {\n schemas = {\n ...schemas,\n ...((components?.schemas as Record<string, OasTypes.SchemaObject>) || {}),\n }\n }\n\n const requestBodies = components?.requestBodies || {}\n if (includes.includes('responses')) {\n const responses = components?.responses || {}\n\n Object.entries(responses).forEach(([name, response]: [string, OasTypes.ResponseObject]) => {\n if (response.content && !schemas[name]) {\n const firstContentType = Object.keys(response.content)[0] || 'application/json'\n schemas[name] = response.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n if (includes.includes('requestBodies')) {\n Object.entries(requestBodies).forEach(([name, request]: [string, OasTypes.RequestBodyObject]) => {\n if (request.content && !schemas[name]) {\n const firstContentType = Object.keys(request.content)[0] || 'application/json'\n schemas[name] = request.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n return schemas\n}\n","import { isOpenApiV3_1Document } from '@kubb/oas'\n\nimport type { Oas, OpenAPIV3, OpenAPIV3_1, SchemaObject } from '@kubb/oas'\n\n/**\n * Make it possible to narrow down the schema based on a specific version(3 or 3.1)\n */\ntype SchemaResult<TWithRef extends boolean = false> =\n | {\n schema?: (TWithRef extends true ? OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject : OpenAPIV3.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.0'\n }\n | {\n schema?: (TWithRef extends true ? OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject : OpenAPIV3_1.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.1'\n }\n\nexport function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (schema?: SchemaObject) => SchemaResult<TWithRef> {\n return (schema?: SchemaObject) => {\n const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'\n\n return {\n schema,\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAUO,SAAS,WAAW,EAAE,KAAK,aAAa,WAAW,CAAC,WAAW,iBAAiB,WAAW,EAAE,GAA2D;AAC7J,QAAM,aAAa,IAAI,cAAc,EAAE;AAEvC,MAAI,UAAiD,CAAC;AAEtD,MAAI,SAAS,SAAS,SAAS,GAAG;AAChC,cAAU;AAAA,MACR,GAAG;AAAA,MACH,GAAK,YAAY,WAAqD,CAAC;AAAA,IACzE;AAAA,EACF;AAEA,QAAM,gBAAgB,YAAY,iBAAiB,CAAC;AACpD,MAAI,SAAS,SAAS,WAAW,GAAG;AAClC,UAAM,YAAY,YAAY,aAAa,CAAC;AAE5C,WAAO,QAAQ,SAAS,EAAE,QAAQ,CAAC,CAAC,MAAM,QAAQ,MAAyC;AACzF,UAAI,SAAS,WAAW,CAAC,QAAQ,IAAI,GAAG;AACtC,cAAM,mBAAmB,OAAO,KAAK,SAAS,OAAO,EAAE,CAAC,KAAK;AAC7D,gBAAQ,IAAI,IAAI,SAAS,UAAU,eAAe,gBAAgB,GAAG;AAAA,MACvE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MAAI,SAAS,SAAS,eAAe,GAAG;AACtC,WAAO,QAAQ,aAAa,EAAE,QAAQ,CAAC,CAAC,MAAM,OAAO,MAA4C;AAC/F,UAAI,QAAQ,WAAW,CAAC,QAAQ,IAAI,GAAG;AACrC,cAAM,mBAAmB,OAAO,KAAK,QAAQ,OAAO,EAAE,CAAC,KAAK;AAC5D,gBAAQ,IAAI,IAAI,QAAQ,UAAU,eAAe,gBAAgB,GAAG;AAAA,MACtE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;;;AC5CA;AAAA,SAAS,6BAA6B;AAuB/B,SAAS,iBAAmD,KAA6D;AAC9H,SAAO,CAAC,WAA0B;AAChC,UAAM,UAAU,sBAAsB,IAAI,GAAG,IAAI,QAAQ;AAEzD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -5,7 +5,7 @@ import {
5
5
  getSchemaFactory,
6
6
  getSchemas,
7
7
  init_esm_shims
8
- } from "./chunk-LRJFQCDO.js";
8
+ } from "./chunk-Y272OQMW.js";
9
9
 
10
10
  // src/SchemaMapper.ts
11
11
  init_esm_shims();
@@ -681,6 +681,9 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
681
681
  ...baseItems
682
682
  ].filter(Boolean);
683
683
  }
684
+ if (!["boolean", "object", "number", "string", "integer"].includes(schema.type)) {
685
+ this.context.pluginManager.logger.emit("warning", `Schema type '${schema.type}' is not valid for schema ${parentName}.${name}`);
686
+ }
684
687
  return [{ keyword: schema.type }, ...baseItems];
685
688
  }
686
689
  return [{ keyword: unknownReturn }];
@@ -692,4 +695,4 @@ export {
692
695
  isKeyword,
693
696
  SchemaGenerator
694
697
  };
695
- //# sourceMappingURL=chunk-UZLE6NIY.js.map
698
+ //# sourceMappingURL=chunk-ZZ7ZC4TT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/SchemaMapper.ts","../src/SchemaGenerator.ts"],"sourcesContent":["import type * as KubbFile from '@kubb/fs/types'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n strict?: boolean\n }\n }\n strict: { keyword: 'strict' }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number'\n value?: string | number\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number'\n value?: string | number\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: { name: string; path: KubbFile.OptionalPath; isTypeOnly?: boolean }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n strict: 'strict',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n optional: 'optional',\n readOnly: 'readOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n","import { type FileMetaBase, Generator } from '@kubb/core'\nimport transformers, { pascalCase } from '@kubb/core/transformers'\nimport { getUniqueName } from '@kubb/core/utils'\n\nimport { isReference } from '@kubb/oas'\nimport { isDeepEqual, isNumber, uniqueWith } from 'remeda'\nimport { isKeyword, schemaKeywords } from './SchemaMapper.ts'\nimport { getSchemaFactory } from './utils/getSchemaFactory.ts'\nimport { getSchemas } from './utils/getSchemas.ts'\n\nimport type { Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from '@kubb/core'\nimport type * as KubbFile from '@kubb/fs/types'\n\nimport type { Oas, OpenAPIV3, SchemaObject, contentType } from '@kubb/oas'\nimport type { Schema, SchemaKeywordMapper } from './SchemaMapper.ts'\nimport type { OperationSchema, Override, Refs } from './types.ts'\n\nexport type GetSchemaGeneratorOptions<T extends SchemaGenerator<any, any, any>> = T extends SchemaGenerator<infer Options, any, any> ? Options : never\n\nexport type SchemaMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>\n\ntype Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {\n oas: Oas\n pluginManager: PluginManager\n /**\n * Current plugin\n */\n plugin: Plugin<TPluginOptions>\n mode: KubbFile.Mode\n include?: Array<'schemas' | 'responses' | 'requestBodies'>\n override: Array<Override<TOptions>> | undefined\n contentType?: contentType\n output?: string\n}\n\nexport type SchemaGeneratorOptions = {\n dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date'\n unknownType: 'any' | 'unknown'\n enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n enumSuffix?: string\n usedEnumNames?: Record<string, number>\n mapper?: Record<string, string>\n typed?: boolean\n transformers: {\n /**\n * Customize the names based on the type that is provided by the plugin.\n */\n name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string\n /**\n * Receive schema and name(propertName) and return FakerMeta array\n * TODO TODO add docs\n * @beta\n */\n schema?: (schemaProps: SchemaProps, defaultSchemas: Schema[]) => Schema[] | undefined\n }\n}\n\nexport type SchemaGeneratorBuildOptions = Omit<OperationSchema, 'name' | 'schema'>\n\ntype SchemaProps = {\n schema?: SchemaObject\n name?: string\n parentName?: string\n}\n\nexport abstract class SchemaGenerator<\n TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions,\n TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions,\n TFileMeta extends FileMetaBase = FileMetaBase,\n> extends Generator<TOptions, Context<TOptions, TPluginOptions>> {\n // Collect the types of all referenced schemas, so we can export them later\n refs: Refs = {}\n\n // Keep track of already used type aliases\n #usedAliasNames: Record<string, number> = {}\n\n /**\n * Creates a type node from a given schema.\n * Delegates to getBaseTypeFromSchema internally and\n * optionally adds a union with null.\n */\n parse(props: SchemaProps): Schema[] {\n const options = this.#getOptions(props)\n\n const defaultSchemas = this.#parseSchemaObject(props)\n const schemas = options.transformers?.schema?.(props, defaultSchemas) || defaultSchemas || []\n\n return uniqueWith(schemas, isDeepEqual)\n }\n\n deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][] {\n return SchemaGenerator.deepSearch<T>(tree, keyword)\n }\n\n find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n return SchemaGenerator.find<T>(tree, keyword)\n }\n\n static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][] {\n const foundItems: SchemaKeywordMapper[T][] = []\n\n tree?.forEach((schema) => {\n if (schema.keyword === keyword) {\n foundItems.push(schema as SchemaKeywordMapper[T])\n }\n\n if (schema.keyword === schemaKeywords.object) {\n const subItem = schema as SchemaKeywordMapper['object']\n\n Object.values(subItem.args?.properties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>(entrySchema, keyword))\n })\n\n Object.values(subItem.args?.additionalProperties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.array) {\n const subItem = schema as SchemaKeywordMapper['array']\n\n subItem.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.and) {\n const subItem = schema as SchemaKeywordMapper['and']\n\n subItem.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.tuple) {\n const subItem = schema as SchemaKeywordMapper['tuple']\n\n subItem.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.union) {\n const subItem = schema as SchemaKeywordMapper['union']\n\n subItem.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n })\n\n return foundItems\n }\n\n static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined = undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (schema.keyword === schemaKeywords.object) {\n const subItem = schema as SchemaKeywordMapper['object']\n\n Object.values(subItem.args?.properties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>(entrySchema, keyword)\n }\n })\n\n Object.values(subItem.args?.additionalProperties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined = undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (schema.keyword === schemaKeywords.array) {\n const subItem = schema as SchemaKeywordMapper['array']\n\n subItem.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.and) {\n const subItem = schema as SchemaKeywordMapper['and']\n\n subItem.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.tuple) {\n const subItem = schema as SchemaKeywordMapper['tuple']\n\n subItem.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.union) {\n const subItem = schema as SchemaKeywordMapper['union']\n\n subItem.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n #getUsedEnumNames(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n return options.usedEnumNames || {}\n }\n\n #getOptions({ name }: SchemaProps): Partial<TOptions> {\n const { override = [] } = this.context\n\n return {\n ...this.options,\n ...(override.find(({ pattern, type }) => {\n if (name && type === 'schemaName') {\n return !!name.match(pattern)\n }\n\n return false\n })?.options || {}),\n }\n }\n\n #getUnknownReturn(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n if (options.unknownType === 'any') {\n return schemaKeywords.any\n }\n\n return schemaKeywords.unknown\n }\n\n /**\n * Recursively creates a type literal with the given props.\n */\n #parseProperties({ schema, name }: SchemaProps): Schema[] {\n const properties = schema?.properties || {}\n const additionalProperties = schema?.additionalProperties\n const required = schema?.required\n\n const propertiesSchemas = Object.keys(properties)\n .map((propertyName) => {\n const validationFunctions: Schema[] = []\n const propertySchema = properties[propertyName] as SchemaObject\n\n const isRequired = Array.isArray(required) ? required?.includes(propertyName) : !!required\n const nullable = propertySchema.nullable ?? propertySchema['x-nullable'] ?? false\n\n validationFunctions.push(...this.parse({ schema: propertySchema, name: propertyName, parentName: name }))\n\n validationFunctions.push({\n keyword: schemaKeywords.name,\n args: propertyName,\n })\n\n if (!isRequired && nullable) {\n validationFunctions.push({ keyword: schemaKeywords.nullish })\n } else if (!isRequired) {\n validationFunctions.push({ keyword: schemaKeywords.optional })\n }\n\n return {\n [propertyName]: validationFunctions,\n }\n })\n .reduce((acc, curr) => ({ ...acc, ...curr }), {})\n let additionalPropertiesSchemas: Schema[] = []\n\n if (additionalProperties) {\n additionalPropertiesSchemas =\n additionalProperties === true\n ? [{ keyword: this.#getUnknownReturn({ schema, name }) }]\n : this.parse({ schema: additionalProperties as SchemaObject, parentName: name })\n }\n\n return [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: propertiesSchemas,\n additionalProperties: additionalPropertiesSchemas,\n },\n },\n ]\n }\n\n /**\n * Create a type alias for the schema referenced by the given ReferenceObject\n */\n #getRefAlias(obj: OpenAPIV3.ReferenceObject): Schema[] {\n const { $ref } = obj\n let ref = this.refs[$ref]\n\n const originalName = getUniqueName($ref.replace(/.+\\//, ''), this.#usedAliasNames)\n const propertyName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'function',\n })\n\n if (ref) {\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, path: ref.path },\n },\n ]\n }\n\n const fileName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'file',\n })\n const file = this.context.pluginManager.getFile({\n name: fileName,\n pluginKey: this.context.plugin.key,\n extName: '.ts',\n })\n\n ref = this.refs[$ref] = {\n propertyName,\n originalName,\n path: file.path,\n }\n\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, path: ref?.path, isTypeOnly: false },\n },\n ]\n }\n\n #getParsedSchemaObject(schema?: SchemaObject) {\n const parsedSchema = getSchemaFactory(this.context.oas)(schema)\n return parsedSchema\n }\n\n /**\n * This is the very core of the OpenAPI to TS conversion - it takes a\n * schema and returns the appropriate type.\n */\n #parseSchemaObject({ schema: _schema, name, parentName }: SchemaProps): Schema[] {\n const options = this.#getOptions({ schema: _schema, name })\n const unknownReturn = this.#getUnknownReturn({ schema: _schema, name })\n const { schema, version } = this.#getParsedSchemaObject(_schema)\n const resolvedName = this.context.pluginManager.resolveName({\n name: `${parentName || ''} ${name}`,\n pluginKey: this.context.plugin.key,\n type: 'type',\n })\n\n if (!schema) {\n return [{ keyword: unknownReturn }]\n }\n\n const baseItems: Schema[] = [\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schema.type as any,\n format: schema.format,\n },\n },\n ]\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n const nullable = schema.nullable ?? schema['x-nullable'] ?? false\n\n if (schema.default !== undefined && !Array.isArray(schema.default)) {\n if (typeof schema.default === 'string') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: transformers.stringify(schema.default),\n })\n }\n if (typeof schema.default === 'boolean') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schema.default ?? false,\n })\n }\n }\n\n if (schema.description) {\n baseItems.push({\n keyword: schemaKeywords.describe,\n args: schema.description,\n })\n }\n\n if (schema.pattern) {\n baseItems.unshift({\n keyword: schemaKeywords.matches,\n args: schema.pattern,\n })\n }\n\n if (max !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.max, args: max })\n }\n\n if (min !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.min, args: min })\n }\n\n if (nullable) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n\n if (schema.type && Array.isArray(schema.type)) {\n const [_schema, nullable] = schema.type\n\n if (nullable === 'null') {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n }\n\n if (schema.readOnly) {\n baseItems.push({ keyword: schemaKeywords.readOnly })\n }\n\n if (isReference(schema)) {\n return [\n ...this.#getRefAlias(schema),\n nullable && { keyword: schemaKeywords.nullable },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schema.type as any,\n format: schema.format,\n },\n },\n ].filter(Boolean)\n }\n\n if (schema.oneOf) {\n // union\n const schemaWithoutOneOf = { ...schema, oneOf: undefined }\n\n const union: Schema = {\n keyword: schemaKeywords.union,\n args: schema.oneOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n }),\n }\n if (schemaWithoutOneOf.properties) {\n return [...this.parse({ schema: schemaWithoutOneOf, name, parentName }), union, ...baseItems]\n }\n\n return [union, ...baseItems]\n }\n\n if (schema.anyOf) {\n // union\n const schemaWithoutAnyOf = { ...schema, anyOf: undefined }\n\n const union: Schema = {\n keyword: schemaKeywords.union,\n args: schema.anyOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n })\n .map((item) => {\n if (isKeyword(item, schemaKeywords.object)) {\n return {\n ...item,\n args: {\n ...item.args,\n strict: true,\n },\n }\n }\n return item\n }),\n }\n if (schemaWithoutAnyOf.properties) {\n return [...this.parse({ schema: schemaWithoutAnyOf, name, parentName }), union, ...baseItems]\n }\n\n return [union, ...baseItems]\n }\n if (schema.allOf) {\n // intersection/add\n const schemaWithoutAllOf = { ...schema, allOf: undefined }\n\n const and: Schema = {\n keyword: schemaKeywords.and,\n args: schema.allOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n }),\n }\n\n if (schemaWithoutAllOf.properties) {\n return [\n {\n ...and,\n args: [...(and.args || []), ...this.parse({ schema: schemaWithoutAllOf, name, parentName })],\n },\n ...baseItems,\n ]\n }\n\n return [and, ...baseItems]\n }\n\n if (schema.enum) {\n const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(' ')), this.#getUsedEnumNames({ schema, name }))\n const typeName = this.context.pluginManager.resolveName({\n name: enumName,\n pluginKey: this.context.plugin.key,\n type: 'type',\n })\n\n const nullableEnum = schema.enum.includes(null)\n if (nullableEnum) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n const filteredValues = schema.enum.filter((value) => value !== null)\n\n // x-enumNames has priority\n const extensionEnums = ['x-enumNames', 'x-enum-varnames']\n .filter((extensionKey) => extensionKey in schema)\n .map((extensionKey) => {\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name,\n typeName,\n asConst: false,\n items: [...new Set(schema[extensionKey as keyof typeof schema] as string[])].map((name: string | number, index) => ({\n name: transformers.stringify(name),\n value: schema.enum?.[index] as string | number,\n format: isNumber(schema.enum?.[index]) ? 'number' : 'string',\n })),\n },\n },\n ...baseItems.filter(\n (item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches,\n ),\n ]\n })\n\n if (schema.type === 'number' || schema.type === 'integer') {\n // we cannot use z.enum when enum type is number/integer\n const enumNames = extensionEnums[0]?.find((item) => isKeyword(item, schemaKeywords.enum)) as unknown as SchemaKeywordMapper['enum']\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: true,\n items: enumNames?.args?.items\n ? [...new Set(enumNames.args.items)].map(({ name, value }) => ({\n name,\n value,\n format: 'number',\n }))\n : [...new Set(filteredValues)].map((value: string) => {\n return {\n name: value,\n value,\n format: 'number',\n }\n }),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if (extensionEnums.length > 0 && extensionEnums[0]) {\n return extensionEnums[0]\n }\n\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: false,\n items: [...new Set(filteredValues)].map((value: string) => ({\n name: transformers.stringify(value),\n value,\n format: isNumber(value) ? 'number' : 'string',\n })),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if ('prefixItems' in schema) {\n const prefixItems = schema.prefixItems as SchemaObject[]\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n\n return [\n {\n keyword: schemaKeywords.tuple,\n args: {\n min,\n max,\n items: prefixItems\n .map((item) => {\n return this.parse({ schema: item, name, parentName })[0]\n })\n .filter(Boolean),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (version === '3.1' && 'const' in schema) {\n // const keyword takes precendence over the actual type.\n if (schema['const']) {\n return [\n {\n keyword: schemaKeywords.const,\n args: {\n name: schema['const'],\n format: typeof schema['const'] === 'number' ? 'number' : 'string',\n value: schema['const'],\n },\n },\n ...baseItems,\n ]\n }\n return [{ keyword: schemaKeywords.null }]\n }\n\n /**\n * > Structural validation alone may be insufficient to allow an application to correctly utilize certain values. The \"format\"\n * > annotation keyword is defined to allow schema authors to convey semantic information for a fixed subset of values which are\n * > accurately described by authoritative resources, be they RFCs or other external specifications.\n *\n * In other words: format is more specific than type alone, hence it should override the type value, if possible.\n *\n * see also https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.7\n */\n if (schema.format) {\n switch (schema.format) {\n case 'binary':\n baseItems.push({ keyword: schemaKeywords.blob })\n return baseItems\n case 'date-time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n if (options.dateType === 'stringOffset') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: true } })\n return baseItems\n }\n\n if (options.dateType === 'stringLocal') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { local: true } })\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: false } })\n\n return baseItems\n }\n break\n case 'date':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'uuid':\n baseItems.unshift({ keyword: schemaKeywords.uuid })\n break\n case 'email':\n case 'idn-email':\n baseItems.unshift({ keyword: schemaKeywords.email })\n break\n case 'uri':\n case 'ipv4':\n case 'ipv6':\n case 'uri-reference':\n case 'hostname':\n case 'idn-hostname':\n baseItems.unshift({ keyword: schemaKeywords.url })\n break\n // case 'duration':\n // case 'json-pointer':\n // case 'relative-json-pointer':\n default:\n // formats not yet implemented: ignore.\n break\n }\n }\n\n // type based logic\n if ('items' in schema || schema.type === ('array' as 'string')) {\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n const items = this.parse({ schema: 'items' in schema ? (schema.items as SchemaObject) : [], name, parentName })\n\n return [\n {\n keyword: schemaKeywords.array,\n args: {\n items,\n min,\n max,\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (schema.properties || schema.additionalProperties) {\n return [...this.#parseProperties({ schema, name }), ...baseItems]\n }\n\n if (schema.type) {\n if (Array.isArray(schema.type)) {\n // OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0\n const [type] = schema.type as Array<OpenAPIV3.NonArraySchemaObjectType>\n\n return [\n ...this.parse({\n schema: {\n ...schema,\n type,\n },\n name,\n parentName,\n }),\n ...baseItems,\n ].filter(Boolean)\n }\n\n if (!['boolean', 'object', 'number', 'string', 'integer'].includes(schema.type)) {\n this.context.pluginManager.logger.emit('warning', `Schema type '${schema.type}' is not valid for schema ${parentName}.${name}`)\n }\n\n // 'string' | 'number' | 'integer' | 'boolean'\n return [{ keyword: schema.type }, ...baseItems]\n }\n\n return [{ keyword: unknownReturn }]\n }\n\n async build(): Promise<Array<KubbFile.File<TFileMeta>>> {\n const { oas, contentType, include } = this.context\n\n const schemas = getSchemas({ oas, contentType, includes: include })\n\n const promises = Object.entries(schemas).reduce((acc, [name, schema]) => {\n const options = this.#getOptions({ name })\n const promiseOperation = this.schema.call(this, name, schema, {\n ...this.options,\n ...options,\n })\n\n if (promiseOperation) {\n acc.push(promiseOperation)\n }\n\n return acc\n }, [] as SchemaMethodResult<TFileMeta>[])\n\n const files = await Promise.all(promises)\n\n // using .flat because schemaGenerator[method] can return a array of files or just one file\n return files.flat().filter(Boolean)\n }\n\n /**\n * Schema\n */\n abstract schema(name: string, object: SchemaObject, options: TOptions): SchemaMethodResult<TFileMeta>\n}\n"],"mappings":";;;;;;;;;;AAAA;AA+EO,IAAM,iBAAiB;AAAA,EAC5B,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AAAA;AAAA,EAEL,SAAS;AAAA,EACT,OAAO;AAAA,EACP,KAAK;AAAA,EACL,UAAU;AAAA,EACV,KAAK;AAAA,EACL,KAAK;AAAA,EACL,UAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAGV,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAA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O,KAAK,YAAY,eAAe,GAAG;AAAA,IAC1G;AAAA,EACF;AAEA,MAAI,OAAO,cAAc,OAAO,sBAAsB;AACpD,WAAO,CAAC,GAAG,sBAAK,gDAAL,WAAsB,EAAE,QAAQ,KAAK,IAAI,GAAG,SAAS;AAAA,EAClE;AAEA,MAAI,OAAO,MAAM;AACf,QAAI,MAAM,QAAQ,OAAO,IAAI,GAAG;AAE9B,YAAM,CAAC,IAAI,IAAI,OAAO;AAEtB,aAAO;AAAA,QACL,GAAG,KAAK,MAAM;AAAA,UACZ,QAAQ;AAAA,YACN,GAAG;AAAA,YACH;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,QACD,GAAG;AAAA,MACL,EAAE,OAAO,OAAO;AAAA,IAClB;AAEA,QAAI,CAAC,CAAC,WAAW,UAAU,UAAU,UAAU,SAAS,EAAE,SAAS,OAAO,IAAI,GAAG;AAC/E,WAAK,QAAQ,cAAc,OAAO,KAAK,WAAW,gBAAgB,OAAO,IAAI,6BAA6B,UAAU,IAAI,IAAI,EAAE;AAAA,IAChI;AAGA,WAAO,CAAC,EAAE,SAAS,OAAO,KAAK,GAAG,GAAG,SAAS;AAAA,EAChD;AAEA,SAAO,CAAC,EAAE,SAAS,cAAc,CAAC;AACpC;AAnvBK,IAAe,kBAAf;","names":["_schema","nullable","name","min","max"]}
@@ -2,17 +2,17 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkTL7TBM2Ucjs = require('./chunk-TL7TBM2U.cjs');
6
- require('./chunk-CCPZYOTX.cjs');
5
+ var _chunkUKUEVTRBcjs = require('./chunk-UKUEVTRB.cjs');
6
+ require('./chunk-K4GEQ3C2.cjs');
7
7
 
8
8
 
9
- var _chunkPFN2GSICcjs = require('./chunk-PFN2GSIC.cjs');
9
+ var _chunkJ7IF3KA3cjs = require('./chunk-J7IF3KA3.cjs');
10
10
 
11
11
  // src/components/index.ts
12
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
12
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.Oas = _chunkTL7TBM2Ucjs.Oas; exports.Operation = _chunkTL7TBM2Ucjs.Operation; exports.Schema = _chunkTL7TBM2Ucjs.Schema;
17
+ exports.Oas = _chunkUKUEVTRBcjs.Oas; exports.Operation = _chunkUKUEVTRBcjs.Operation; exports.Schema = _chunkUKUEVTRBcjs.Schema;
18
18
  //# sourceMappingURL=components.cjs.map
@@ -1,12 +1,12 @@
1
- import { S as Schema } from './Schema-FGI5VPqc.cjs';
1
+ import { S as Schema } from './Schema-an5hOrjZ.cjs';
2
2
  import * as react from 'react';
3
3
  import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
4
4
  import { KubbNode } from '@kubb/react';
5
- import { a as OperationGenerator } from './OperationGenerator-BV6QRtkW.cjs';
6
- import './SchemaMapper-CsBQ6eEx.cjs';
5
+ import { a as OperationGenerator } from './OperationGenerator-CrCcKl3S.cjs';
7
6
  import '@kubb/fs/types';
7
+ import './SchemaMapper-CsBQ6eEx.cjs';
8
8
  import '@kubb/core';
9
- import './types-Db0qp8u-.cjs';
9
+ import './types-BP45TdiW.cjs';
10
10
  import '@kubb/oas/parser';
11
11
 
12
12
  type Props$1 = {
@@ -1,12 +1,12 @@
1
- import { S as Schema } from './Schema-D41ItX9C.js';
1
+ import { S as Schema } from './Schema-DefwBJMc.js';
2
2
  import * as react from 'react';
3
3
  import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
4
4
  import { KubbNode } from '@kubb/react';
5
- import { a as OperationGenerator } from './OperationGenerator-DO5tNGuT.js';
6
- import './SchemaMapper-CsBQ6eEx.js';
5
+ import { a as OperationGenerator } from './OperationGenerator-B0RLFu4P.js';
7
6
  import '@kubb/fs/types';
7
+ import './SchemaMapper-CsBQ6eEx.js';
8
8
  import '@kubb/core';
9
- import './types-Db0qp8u-.js';
9
+ import './types-BP45TdiW.js';
10
10
  import '@kubb/oas/parser';
11
11
 
12
12
  type Props$1 = {
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  Schema
5
- } from "./chunk-KI3GNEKH.js";
6
- import "./chunk-UZLE6NIY.js";
5
+ } from "./chunk-QSM6A5QX.js";
6
+ import "./chunk-ZZ7ZC4TT.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-LRJFQCDO.js";
9
+ } from "./chunk-Y272OQMW.js";
10
10
 
11
11
  // src/components/index.ts
12
12
  init_esm_shims();
package/dist/hooks.cjs CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkTL7TBM2Ucjs = require('./chunk-TL7TBM2U.cjs');
6
- require('./chunk-CCPZYOTX.cjs');
5
+ var _chunkUKUEVTRBcjs = require('./chunk-UKUEVTRB.cjs');
6
+ require('./chunk-K4GEQ3C2.cjs');
7
7
 
8
8
 
9
- var _chunkPFN2GSICcjs = require('./chunk-PFN2GSIC.cjs');
9
+ var _chunkJ7IF3KA3cjs = require('./chunk-J7IF3KA3.cjs');
10
10
 
11
11
  // src/hooks/index.ts
12
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
12
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
  // src/hooks/useOas.ts
15
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
15
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
16
16
  var _react = require('@kubb/react');
17
17
  function useOas() {
18
- const { oas } = _react.useContext.call(void 0, _chunkTL7TBM2Ucjs.Oas.Context);
18
+ const { oas } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Oas.Context);
19
19
  if (!oas) {
20
20
  throw new Error("Oas is not defined");
21
21
  }
@@ -23,10 +23,10 @@ function useOas() {
23
23
  }
24
24
 
25
25
  // src/hooks/useOperation.ts
26
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
26
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
27
27
 
28
28
  function useOperation() {
29
- const { operation } = _react.useContext.call(void 0, _chunkTL7TBM2Ucjs.Operation.Context);
29
+ const { operation } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Operation.Context);
30
30
  if (!operation) {
31
31
  throw new Error("Operation is not defined");
32
32
  }
@@ -34,11 +34,11 @@ function useOperation() {
34
34
  }
35
35
 
36
36
  // src/hooks/useOperationManager.ts
37
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
37
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
38
38
 
39
39
  function useOperationManager() {
40
40
  const { plugin, pluginManager } = _react.useApp.call(void 0, );
41
- const { generator } = _react.useContext.call(void 0, _chunkTL7TBM2Ucjs.Oas.Context);
41
+ const { generator } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Oas.Context);
42
42
  if (!generator) {
43
43
  throw new Error(`'generator' is not defined`);
44
44
  }
@@ -139,10 +139,10 @@ function useOperationManager() {
139
139
  }
140
140
 
141
141
  // src/hooks/useOperations.ts
142
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
142
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
143
143
 
144
144
  function useOperations({ method, path } = {}) {
145
- const { operations } = _react.useContext.call(void 0, _chunkTL7TBM2Ucjs.Oas.Context);
145
+ const { operations } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Oas.Context);
146
146
  if (!operations) {
147
147
  throw new Error("Operations is not defined");
148
148
  }
@@ -161,5 +161,5 @@ function useOperations({ method, path } = {}) {
161
161
 
162
162
 
163
163
 
164
- exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkTL7TBM2Ucjs.useSchema;
164
+ exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkUKUEVTRBcjs.useSchema;
165
165
  //# sourceMappingURL=hooks.cjs.map
package/dist/hooks.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Oas, Operation, HttpMethod } from '@kubb/oas';
2
2
  import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
3
3
  import * as KubbFile from '@kubb/fs/types';
4
- import { f as OperationSchemas } from './types-Db0qp8u-.cjs';
5
- import { a as SchemaContextProps } from './Schema-FGI5VPqc.cjs';
4
+ import { f as OperationSchemas } from './types-BP45TdiW.cjs';
5
+ import { a as SchemaContextProps } from './Schema-an5hOrjZ.cjs';
6
6
  import '@kubb/oas/parser';
7
7
  import 'react';
8
8
  import '@kubb/react';
package/dist/hooks.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Oas, Operation, HttpMethod } from '@kubb/oas';
2
2
  import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
3
3
  import * as KubbFile from '@kubb/fs/types';
4
- import { f as OperationSchemas } from './types-Db0qp8u-.js';
5
- import { a as SchemaContextProps } from './Schema-D41ItX9C.js';
4
+ import { f as OperationSchemas } from './types-BP45TdiW.js';
5
+ import { a as SchemaContextProps } from './Schema-DefwBJMc.js';
6
6
  import '@kubb/oas/parser';
7
7
  import 'react';
8
8
  import '@kubb/react';
package/dist/hooks.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  useSchema
5
- } from "./chunk-KI3GNEKH.js";
6
- import "./chunk-UZLE6NIY.js";
5
+ } from "./chunk-QSM6A5QX.js";
6
+ import "./chunk-ZZ7ZC4TT.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-LRJFQCDO.js";
9
+ } from "./chunk-Y272OQMW.js";
10
10
 
11
11
  // src/hooks/index.ts
12
12
  init_esm_shims();
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkCO7DS2KLcjs = require('./chunk-CO7DS2KL.cjs');
3
+ var _chunk3UN2S6P2cjs = require('./chunk-3UN2S6P2.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkCCPZYOTXcjs = require('./chunk-CCPZYOTX.cjs');
8
+ var _chunkK4GEQ3C2cjs = require('./chunk-K4GEQ3C2.cjs');
9
9
 
10
10
 
11
11
 
@@ -13,13 +13,13 @@ var _chunkCCPZYOTXcjs = require('./chunk-CCPZYOTX.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunkPFN2GSICcjs = require('./chunk-PFN2GSIC.cjs');
16
+ var _chunkJ7IF3KA3cjs = require('./chunk-J7IF3KA3.cjs');
17
17
 
18
18
  // src/index.ts
19
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
19
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
20
20
 
21
21
  // src/plugin.ts
22
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
22
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
23
23
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
24
24
  var _core = require('@kubb/core');
25
25
  var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
@@ -36,7 +36,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
36
36
  } = options;
37
37
  const getOas = async ({ config, logger, formatOptions }) => {
38
38
  try {
39
- const oas = await _chunkCO7DS2KLcjs.parseFromConfig.call(void 0, config, formatOptions, oasClass);
39
+ const oas = await _chunk3UN2S6P2cjs.parseFromConfig.call(void 0, config, formatOptions, oasClass);
40
40
  if (validate) {
41
41
  await oas.valdiate();
42
42
  }
@@ -44,7 +44,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
44
44
  } catch (e) {
45
45
  const error = e;
46
46
  logger.emit("warning", _optionalChain([error, 'optionalAccess', _ => _.message]));
47
- return _chunkCO7DS2KLcjs.parseFromConfig.call(void 0, config, {}, oasClass);
47
+ return _chunk3UN2S6P2cjs.parseFromConfig.call(void 0, config, {}, oasClass);
48
48
  }
49
49
  };
50
50
  return {
@@ -58,7 +58,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
58
58
  },
59
59
  async getSchemas({ includes } = {}) {
60
60
  const oas = await this.getOas();
61
- return _chunkPFN2GSICcjs.getSchemas.call(void 0, { oas, contentType, includes });
61
+ return _chunkJ7IF3KA3cjs.getSchemas.call(void 0, { oas, contentType, includes });
62
62
  },
63
63
  async getBaseURL() {
64
64
  const oasInstance = await this.getOas();
@@ -97,7 +97,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
97
97
  }
98
98
  });
99
99
  await oas.dereference();
100
- const schemas = _chunkPFN2GSICcjs.getSchemas.call(void 0, { oas, contentType });
100
+ const schemas = _chunkJ7IF3KA3cjs.getSchemas.call(void 0, { oas, contentType });
101
101
  const mapSchema = async ([name, schema]) => {
102
102
  const resolvedPath = this.resolvePath({
103
103
  baseName: `${name}.json`,
@@ -127,21 +127,21 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
127
127
  });
128
128
 
129
129
  // src/OperationGenerator.ts
130
- _chunkPFN2GSICcjs.init_cjs_shims.call(void 0, );
130
+ _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
131
131
 
132
132
 
133
133
  var _operationsByMethod, _OperationGenerator_instances, getOptions_fn, isExcluded_fn, isIncluded_fn, methods_get;
134
134
  var OperationGenerator = class extends _core.Generator {
135
135
  constructor() {
136
136
  super(...arguments);
137
- _chunkPFN2GSICcjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
138
- _chunkPFN2GSICcjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
137
+ _chunkJ7IF3KA3cjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
138
+ _chunkJ7IF3KA3cjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
139
139
  }
140
140
  get operationsByMethod() {
141
- return _chunkPFN2GSICcjs.__privateGet.call(void 0, this, _operationsByMethod);
141
+ return _chunkJ7IF3KA3cjs.__privateGet.call(void 0, this, _operationsByMethod);
142
142
  }
143
143
  set operationsByMethod(paths) {
144
- _chunkPFN2GSICcjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
144
+ _chunkJ7IF3KA3cjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
145
145
  }
146
146
  getSchemas(operation, { forStatusCode, resolveName = (name) => name } = {}) {
147
147
  const pathParamsSchema = this.context.oas.getParametersSchema(operation, "path");
@@ -224,9 +224,9 @@ var OperationGenerator = class extends _core.Generator {
224
224
  const methods = Object.keys(method);
225
225
  methods.forEach((method2) => {
226
226
  const operation = oas.operation(path2, method2);
227
- if (operation && _chunkPFN2GSICcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
228
- const isExcluded = _chunkPFN2GSICcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
229
- const isIncluded = this.context.include ? _chunkPFN2GSICcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
227
+ if (operation && _chunkJ7IF3KA3cjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
228
+ const isExcluded = _chunkJ7IF3KA3cjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
229
+ const isIncluded = this.context.include ? _chunkJ7IF3KA3cjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
230
230
  if (isIncluded && !isExcluded) {
231
231
  if (!acc[path2]) {
232
232
  acc[path2] = {};
@@ -247,8 +247,8 @@ var OperationGenerator = class extends _core.Generator {
247
247
  const methods = this.operationsByMethod[path2] ? Object.keys(this.operationsByMethod[path2]) : [];
248
248
  methods.forEach((method) => {
249
249
  const { operation } = _optionalChain([this, 'access', _37 => _37.operationsByMethod, 'access', _38 => _38[path2], 'optionalAccess', _39 => _39[method]]);
250
- const options = _chunkPFN2GSICcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
251
- const promiseMethod = _optionalChain([_chunkPFN2GSICcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
250
+ const options = _chunkJ7IF3KA3cjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
251
+ const promiseMethod = _optionalChain([_chunkJ7IF3KA3cjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
252
252
  ...this.options,
253
253
  ...options
254
254
  })]);
@@ -403,5 +403,5 @@ var src_default = definePluginDefault;
403
403
 
404
404
 
405
405
 
406
- exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkCCPZYOTXcjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkCCPZYOTXcjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkCCPZYOTXcjs.schemaKeywords;
406
+ exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkK4GEQ3C2cjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkK4GEQ3C2cjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkK4GEQ3C2cjs.schemaKeywords;
407
407
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
2
  import { FileMetaBase, ResolveNameParams, PluginFactoryOptions, Generator, PluginManager, Plugin } from '@kubb/core';
3
- import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-Db0qp8u-.cjs';
4
- export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-Db0qp8u-.cjs';
5
- export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-BV6QRtkW.cjs';
3
+ import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-BP45TdiW.cjs';
4
+ export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-BP45TdiW.cjs';
5
+ export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-CrCcKl3S.cjs';
6
6
  import * as KubbFile from '@kubb/fs/types';
7
7
  import { SchemaObject, Oas, contentType } from '@kubb/oas';
8
8
  import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-CsBQ6eEx.cjs';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
2
  import { FileMetaBase, ResolveNameParams, PluginFactoryOptions, Generator, PluginManager, Plugin } from '@kubb/core';
3
- import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-Db0qp8u-.js';
4
- export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-Db0qp8u-.js';
5
- export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-DO5tNGuT.js';
3
+ import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-BP45TdiW.js';
4
+ export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-BP45TdiW.js';
5
+ export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-B0RLFu4P.js';
6
6
  import * as KubbFile from '@kubb/fs/types';
7
7
  import { SchemaObject, Oas, contentType } from '@kubb/oas';
8
8
  import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-CsBQ6eEx.js';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  parseFromConfig
3
- } from "./chunk-EK7UO5ZW.js";
3
+ } from "./chunk-GUPCIAYT.js";
4
4
  import {
5
5
  SchemaGenerator,
6
6
  isKeyword,
7
7
  schemaKeywords
8
- } from "./chunk-UZLE6NIY.js";
8
+ } from "./chunk-ZZ7ZC4TT.js";
9
9
  import {
10
10
  __privateAdd,
11
11
  __privateGet,
@@ -13,7 +13,7 @@ import {
13
13
  __privateSet,
14
14
  getSchemas,
15
15
  init_esm_shims
16
- } from "./chunk-LRJFQCDO.js";
16
+ } from "./chunk-Y272OQMW.js";
17
17
 
18
18
  // src/index.ts
19
19
  init_esm_shims();
@@ -60,7 +60,7 @@ type Options = {
60
60
  * `originalName` is the original name used(in PascalCase), only used to remove duplicates
61
61
  *
62
62
  * `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
63
- * @example import a type(swagger-ts) for a mock file(swagger-faker)
63
+ * @example import a type(plugin-ts) for a mock file(swagger-faker)
64
64
  */
65
65
  type Ref = {
66
66
  propertyName: string;
@@ -60,7 +60,7 @@ type Options = {
60
60
  * `originalName` is the original name used(in PascalCase), only used to remove duplicates
61
61
  *
62
62
  * `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
63
- * @example import a type(swagger-ts) for a mock file(swagger-faker)
63
+ * @example import a type(plugin-ts) for a mock file(swagger-faker)
64
64
  */
65
65
  type Ref = {
66
66
  propertyName: string;