@kubb/plugin-oas 3.18.3 → 4.0.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 (45) hide show
  1. package/dist/{Oas-Cv_pyXRM.cjs → Oas--cvTRMTA.cjs} +5 -3
  2. package/dist/{Oas-Cv_pyXRM.cjs.map → Oas--cvTRMTA.cjs.map} +1 -1
  3. package/dist/Oas-CuqAnIw-.js.map +1 -1
  4. package/dist/{SchemaGenerator-lmKFLG0M.cjs → SchemaGenerator-B1V8RwS0.cjs} +36 -46
  5. package/dist/SchemaGenerator-B1V8RwS0.cjs.map +1 -0
  6. package/dist/{SchemaGenerator-WslcpOxc.js → SchemaGenerator-C_u_E-pk.js} +25 -40
  7. package/dist/SchemaGenerator-C_u_E-pk.js.map +1 -0
  8. package/dist/SchemaMapper-BaZQKrQB.js.map +1 -1
  9. package/dist/SchemaMapper-D8J0V9Pj.cjs.map +1 -1
  10. package/dist/components.cjs +1 -1
  11. package/dist/components.d.ts +3 -3
  12. package/dist/{generators-BhLMlRNk.js → generators-CW7v1RgJ.js} +8 -9
  13. package/dist/{generators-BhLMlRNk.js.map → generators-CW7v1RgJ.js.map} +1 -1
  14. package/dist/{generators-DLH2kvlh.cjs → generators-L3av7_7B.cjs} +15 -13
  15. package/dist/{generators-DLH2kvlh.cjs.map → generators-L3av7_7B.cjs.map} +1 -1
  16. package/dist/generators.cjs +3 -3
  17. package/dist/generators.js +2 -2
  18. package/dist/{getFooter-BChY2kC1.cjs → getFooter-B_nmsoeK.cjs} +6 -4
  19. package/dist/{getFooter-BChY2kC1.cjs.map → getFooter-B_nmsoeK.cjs.map} +1 -1
  20. package/dist/{getFooter-T7_pZ6f8.js → getFooter-DM8B8cnC.js} +2 -2
  21. package/dist/{getFooter-T7_pZ6f8.js.map → getFooter-DM8B8cnC.js.map} +1 -1
  22. package/dist/{getSchemas-D8mP129c.cjs → getSchemas-08CU8KWq.cjs} +3 -2
  23. package/dist/{getSchemas-D8mP129c.cjs.map → getSchemas-08CU8KWq.cjs.map} +1 -1
  24. package/dist/getSchemas-WoSBIxG8.js.map +1 -1
  25. package/dist/hooks.cjs +8 -9
  26. package/dist/hooks.cjs.map +1 -1
  27. package/dist/hooks.js +4 -6
  28. package/dist/hooks.js.map +1 -1
  29. package/dist/index.cjs +21 -25
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.js +12 -19
  32. package/dist/index.js.map +1 -1
  33. package/dist/mocks.cjs.map +1 -1
  34. package/dist/mocks.js.map +1 -1
  35. package/dist/{parseFromConfig-CMNGsef2.cjs → parseFromConfig-CFzprC8B.cjs} +9 -5
  36. package/dist/{parseFromConfig-CMNGsef2.cjs.map → parseFromConfig-CFzprC8B.cjs.map} +1 -1
  37. package/dist/parseFromConfig-yAiFK03V.js.map +1 -1
  38. package/dist/utils.cjs +9 -6
  39. package/dist/utils.cjs.map +1 -1
  40. package/dist/utils.js +1 -1
  41. package/dist/utils.js.map +1 -1
  42. package/package.json +7 -7
  43. package/src/SchemaGenerator.ts +1 -7
  44. package/dist/SchemaGenerator-WslcpOxc.js.map +0 -1
  45. package/dist/SchemaGenerator-lmKFLG0M.cjs.map +0 -1
package/dist/mocks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mocks.js","names":["basic: Array<{ name: string; schema: Schema }>","full: Array<{ name: string; schema: Schema[] }>"],"sources":["../src/mocks/schemas.ts"],"sourcesContent":["import { type Schema, schemaKeywords } from '../SchemaMapper'\n\nconst basic: Array<{ name: string; schema: Schema }> = [\n {\n name: 'any',\n schema: {\n keyword: schemaKeywords.any,\n },\n },\n {\n name: 'unknown',\n schema: {\n keyword: schemaKeywords.unknown,\n },\n },\n {\n name: 'string',\n schema: {\n keyword: schemaKeywords.string,\n },\n },\n {\n name: 'number',\n schema: {\n keyword: schemaKeywords.number,\n },\n },\n {\n name: 'integer',\n schema: {\n keyword: schemaKeywords.integer,\n },\n },\n {\n name: 'boolean',\n schema: {\n keyword: schemaKeywords.boolean,\n },\n },\n {\n name: 'primitiveDate',\n schema: {\n keyword: schemaKeywords.date,\n args: {\n type: 'date',\n },\n },\n },\n {\n name: 'date',\n schema: {\n keyword: schemaKeywords.date,\n args: {\n type: 'string',\n },\n },\n },\n {\n name: 'time',\n schema: {\n keyword: schemaKeywords.time,\n args: {\n type: 'string',\n },\n },\n },\n {\n name: 'stringOffset',\n schema: {\n keyword: schemaKeywords.datetime,\n args: {\n offset: true,\n },\n },\n },\n {\n name: 'stringLocal',\n schema: {\n keyword: schemaKeywords.datetime,\n args: {\n local: true,\n },\n },\n },\n {\n name: 'datetime',\n schema: {\n keyword: schemaKeywords.datetime,\n args: {\n offset: false,\n },\n },\n },\n {\n name: 'nullable',\n schema: {\n keyword: schemaKeywords.nullable,\n },\n },\n {\n name: 'undefined',\n schema: {\n keyword: schemaKeywords.undefined,\n },\n },\n {\n name: 'min',\n schema: {\n keyword: schemaKeywords.min,\n args: 2,\n },\n },\n {\n name: 'max',\n schema: {\n keyword: schemaKeywords.max,\n args: 2,\n },\n },\n {\n name: 'matchesReg',\n schema: {\n keyword: schemaKeywords.matches,\n args: '/node_modules/', // pure regexp\n },\n },\n {\n name: 'matches',\n schema: {\n keyword: schemaKeywords.matches,\n args: '^[A-Z]{2}$',\n },\n },\n {\n name: 'const',\n schema: {\n keyword: schemaKeywords.const,\n args: {\n name: '',\n value: '',\n format: schemaKeywords.string,\n },\n },\n },\n {\n name: 'ref',\n schema: {\n keyword: schemaKeywords.ref,\n args: {\n $ref: '$ref',\n name: 'Pet',\n path: './pet.ts',\n isImportable: true,\n },\n },\n },\n {\n name: 'enum',\n schema: {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n { name: 'C', value: 'C', format: schemaKeywords.string },\n { name: 2, value: 2, format: schemaKeywords.number },\n ],\n },\n },\n },\n {\n name: 'enumLiteralBoolean',\n schema: {\n keyword: schemaKeywords.enum,\n args: {\n asConst: true,\n items: [\n {\n format: 'boolean',\n name: 'true',\n value: true,\n },\n {\n format: 'boolean',\n name: 'false',\n value: false,\n },\n ],\n name: 'PetEnumLiteral',\n typeName: 'PetEnumLiteral',\n },\n },\n },\n {\n name: 'tuple',\n schema: {\n keyword: schemaKeywords.tuple,\n args: {\n items: [],\n },\n },\n },\n {\n name: 'tupleMulti',\n schema: {\n keyword: schemaKeywords.tuple,\n args: {\n items: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n },\n },\n {\n name: 'array',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [\n {\n keyword: schemaKeywords.union,\n args: [{ keyword: schemaKeywords.number }, { keyword: schemaKeywords.string }],\n },\n ],\n },\n },\n },\n {\n name: 'arrayEmpty',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [],\n },\n },\n },\n {\n name: 'arrayRef',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [\n {\n keyword: schemaKeywords.ref,\n\n args: { name: 'Pet', $ref: '#component/schema/Pet', path: './pet.ts', isImportable: true },\n },\n ],\n },\n },\n },\n {\n name: 'arrayAdvanced',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [{ keyword: schemaKeywords.min, args: 1 }, { keyword: schemaKeywords.max, args: 10 }, { keyword: schemaKeywords.number }],\n min: 3,\n max: 10,\n },\n },\n },\n {\n name: 'arrayRegex',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [{ keyword: schemaKeywords.matches, args: '^[a-zA-Z0-9]{1,13}$' }],\n min: 3,\n max: 10,\n },\n },\n },\n {\n name: 'union',\n schema: {\n keyword: schemaKeywords.union,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n },\n {\n name: 'unionOne',\n schema: {\n keyword: schemaKeywords.union,\n args: [{ keyword: schemaKeywords.string }],\n },\n },\n {\n name: 'catchall',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.ref,\n args: { name: 'Pet', $ref: '#component/schema/Pet', path: './Pet.ts', isImportable: true },\n },\n ],\n },\n },\n },\n {\n name: 'and',\n schema: {\n keyword: schemaKeywords.and,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n },\n {\n name: 'object',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.min, args: 2 }],\n address: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.nullable }, { keyword: schemaKeywords.describe, args: '\"Your address\"' }],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectOptional',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.optional }, { keyword: schemaKeywords.min, args: 2 }],\n address: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.nullable }, { keyword: schemaKeywords.describe, args: '\"Your address\"' }],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectArray',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n ids: [\n {\n keyword: schemaKeywords.array,\n args: {\n items: [{ keyword: schemaKeywords.matches, args: '^[a-zA-Z0-9]{1,13}$' }],\n min: 3,\n max: 10,\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectDates',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n dateTime: [{ keyword: schemaKeywords.datetime, args: { offset: true } }],\n date: [{ keyword: schemaKeywords.date, args: { type: 'string' } }],\n time: [{ keyword: schemaKeywords.time, args: { type: 'string' } }],\n nativeDate: [{ keyword: schemaKeywords.date, args: { type: 'date' } }],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectAnd',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [\n { keyword: schemaKeywords.deprecated },\n { keyword: schemaKeywords.default, args: 'test' },\n {\n keyword: schemaKeywords.min,\n args: 2,\n },\n {\n keyword: schemaKeywords.string,\n },\n ],\n age: [\n { keyword: schemaKeywords.example, args: '2' },\n { keyword: schemaKeywords.default, args: 2 },\n {\n keyword: schemaKeywords.min,\n args: 3,\n },\n {\n keyword: schemaKeywords.number,\n },\n ],\n address: [\n {\n keyword: schemaKeywords.and,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n { keyword: schemaKeywords.nullable },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectEnum',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n version: [\n {\n keyword: schemaKeywords.schema,\n args: {\n format: 'string',\n type: 'string',\n },\n },\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n { name: 'C', value: 'C', format: schemaKeywords.string },\n { name: 2, value: 2, format: schemaKeywords.number },\n ],\n },\n },\n {\n keyword: schemaKeywords.min,\n args: 4,\n },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectObjectEnum',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n prop1: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n prop2: [\n {\n keyword: schemaKeywords.schema,\n args: { format: 'string', type: 'string' },\n },\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n ],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectArrayObject',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n ids: [\n {\n keyword: schemaKeywords.array,\n args: {\n items: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n enum: [\n {\n keyword: schemaKeywords.schema,\n args: {\n format: 'string',\n type: 'string',\n },\n },\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n { name: 'C', value: 'C', format: schemaKeywords.string },\n { name: 2, value: 2, format: schemaKeywords.number },\n ],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n min: 3,\n max: 10,\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectEmpty',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [],\n },\n },\n },\n {\n name: 'default',\n schema: {\n keyword: schemaKeywords.default,\n },\n },\n {\n name: 'default',\n schema: {\n keyword: schemaKeywords.default,\n args: 'default',\n },\n },\n {\n name: 'blob',\n schema: {\n keyword: schemaKeywords.blob,\n },\n },\n {\n name: 'nullableAdditionalProperties',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.string,\n },\n {\n args: {\n format: undefined,\n type: schemaKeywords.string,\n },\n keyword: schemaKeywords.schema,\n },\n {\n keyword: schemaKeywords.nullable,\n },\n ],\n },\n },\n },\n]\n\nconst full: Array<{ name: string; schema: Schema[] }> = [\n {\n name: 'Upload',\n schema: [\n {\n keyword: schemaKeywords.blob,\n },\n ],\n },\n {\n name: 'PageSizeNumber',\n schema: [\n {\n keyword: schemaKeywords.number,\n },\n {\n keyword: schemaKeywords.default,\n args: 10,\n },\n ],\n },\n {\n name: 'PageSizeInteger',\n schema: [\n {\n keyword: schemaKeywords.integer,\n },\n {\n keyword: schemaKeywords.default,\n args: 10,\n },\n ],\n },\n {\n name: 'Object',\n schema: [\n { keyword: schemaKeywords.nullable },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [\n { keyword: schemaKeywords.deprecated },\n { keyword: schemaKeywords.default, args: 'test' },\n {\n keyword: schemaKeywords.min,\n args: 2,\n },\n {\n keyword: schemaKeywords.string,\n },\n ],\n age: [\n { keyword: schemaKeywords.example, args: '2' },\n { keyword: schemaKeywords.default, args: 2 },\n {\n keyword: schemaKeywords.min,\n args: 2,\n },\n {\n keyword: schemaKeywords.number,\n },\n ],\n address: [\n {\n keyword: schemaKeywords.and,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n { keyword: schemaKeywords.nullable },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n },\n {\n name: 'Order',\n schema: [\n {\n keyword: schemaKeywords.schema,\n args: {\n type: 'object',\n },\n },\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n status: [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'orderStatus',\n asConst: false,\n typeName: 'OrderStatus',\n items: [\n { name: 'Placed', value: 'placed', format: 'string' },\n { name: 'Approved', value: 'approved', format: 'string' },\n ],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n },\n {\n name: 'nullableAdditionalProperties',\n schema: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.string,\n },\n {\n args: {\n format: undefined,\n type: schemaKeywords.string,\n },\n keyword: schemaKeywords.schema,\n },\n {\n keyword: schemaKeywords.number,\n },\n ],\n },\n },\n ],\n },\n {\n name: 'Record',\n schema: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.integer,\n },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: 'integer',\n format: 'int32',\n },\n },\n {\n keyword: schemaKeywords.optional,\n },\n ],\n },\n },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: 'integer',\n format: 'int32',\n },\n },\n {\n keyword: schemaKeywords.optional,\n },\n ],\n },\n]\n\nexport const schemas = {\n basic,\n full,\n}\n"],"mappings":";;;AAEA,MAAMA,QAAiD;CACrD;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,MAAM;;;CAIZ;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,MAAM;;;CAIZ;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,MAAM;;;CAIZ;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,QAAQ;;;CAId;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,OAAO;;;CAIb;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,QAAQ;;;CAId;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe;;CAG5B;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM;;;CAGV;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM;;;CAGV;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM;;;CAGV;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM;;;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AAa,UAAU;CACrB;CACA"}
1
+ {"version":3,"file":"mocks.js","names":["basic: Array<{ name: string; schema: Schema }>","full: Array<{ name: string; schema: Schema[] }>"],"sources":["../src/mocks/schemas.ts"],"sourcesContent":["import { type Schema, schemaKeywords } from '../SchemaMapper'\n\nconst basic: Array<{ name: string; schema: Schema }> = [\n {\n name: 'any',\n schema: {\n keyword: schemaKeywords.any,\n },\n },\n {\n name: 'unknown',\n schema: {\n keyword: schemaKeywords.unknown,\n },\n },\n {\n name: 'string',\n schema: {\n keyword: schemaKeywords.string,\n },\n },\n {\n name: 'number',\n schema: {\n keyword: schemaKeywords.number,\n },\n },\n {\n name: 'integer',\n schema: {\n keyword: schemaKeywords.integer,\n },\n },\n {\n name: 'boolean',\n schema: {\n keyword: schemaKeywords.boolean,\n },\n },\n {\n name: 'primitiveDate',\n schema: {\n keyword: schemaKeywords.date,\n args: {\n type: 'date',\n },\n },\n },\n {\n name: 'date',\n schema: {\n keyword: schemaKeywords.date,\n args: {\n type: 'string',\n },\n },\n },\n {\n name: 'time',\n schema: {\n keyword: schemaKeywords.time,\n args: {\n type: 'string',\n },\n },\n },\n {\n name: 'stringOffset',\n schema: {\n keyword: schemaKeywords.datetime,\n args: {\n offset: true,\n },\n },\n },\n {\n name: 'stringLocal',\n schema: {\n keyword: schemaKeywords.datetime,\n args: {\n local: true,\n },\n },\n },\n {\n name: 'datetime',\n schema: {\n keyword: schemaKeywords.datetime,\n args: {\n offset: false,\n },\n },\n },\n {\n name: 'nullable',\n schema: {\n keyword: schemaKeywords.nullable,\n },\n },\n {\n name: 'undefined',\n schema: {\n keyword: schemaKeywords.undefined,\n },\n },\n {\n name: 'min',\n schema: {\n keyword: schemaKeywords.min,\n args: 2,\n },\n },\n {\n name: 'max',\n schema: {\n keyword: schemaKeywords.max,\n args: 2,\n },\n },\n {\n name: 'matchesReg',\n schema: {\n keyword: schemaKeywords.matches,\n args: '/node_modules/', // pure regexp\n },\n },\n {\n name: 'matches',\n schema: {\n keyword: schemaKeywords.matches,\n args: '^[A-Z]{2}$',\n },\n },\n {\n name: 'const',\n schema: {\n keyword: schemaKeywords.const,\n args: {\n name: '',\n value: '',\n format: schemaKeywords.string,\n },\n },\n },\n {\n name: 'ref',\n schema: {\n keyword: schemaKeywords.ref,\n args: {\n $ref: '$ref',\n name: 'Pet',\n path: './pet.ts',\n isImportable: true,\n },\n },\n },\n {\n name: 'enum',\n schema: {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n { name: 'C', value: 'C', format: schemaKeywords.string },\n { name: 2, value: 2, format: schemaKeywords.number },\n ],\n },\n },\n },\n {\n name: 'enumLiteralBoolean',\n schema: {\n keyword: schemaKeywords.enum,\n args: {\n asConst: true,\n items: [\n {\n format: 'boolean',\n name: 'true',\n value: true,\n },\n {\n format: 'boolean',\n name: 'false',\n value: false,\n },\n ],\n name: 'PetEnumLiteral',\n typeName: 'PetEnumLiteral',\n },\n },\n },\n {\n name: 'tuple',\n schema: {\n keyword: schemaKeywords.tuple,\n args: {\n items: [],\n },\n },\n },\n {\n name: 'tupleMulti',\n schema: {\n keyword: schemaKeywords.tuple,\n args: {\n items: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n },\n },\n {\n name: 'array',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [\n {\n keyword: schemaKeywords.union,\n args: [{ keyword: schemaKeywords.number }, { keyword: schemaKeywords.string }],\n },\n ],\n },\n },\n },\n {\n name: 'arrayEmpty',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [],\n },\n },\n },\n {\n name: 'arrayRef',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [\n {\n keyword: schemaKeywords.ref,\n\n args: { name: 'Pet', $ref: '#component/schema/Pet', path: './pet.ts', isImportable: true },\n },\n ],\n },\n },\n },\n {\n name: 'arrayAdvanced',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [{ keyword: schemaKeywords.min, args: 1 }, { keyword: schemaKeywords.max, args: 10 }, { keyword: schemaKeywords.number }],\n min: 3,\n max: 10,\n },\n },\n },\n {\n name: 'arrayRegex',\n schema: {\n keyword: schemaKeywords.array,\n args: {\n items: [{ keyword: schemaKeywords.matches, args: '^[a-zA-Z0-9]{1,13}$' }],\n min: 3,\n max: 10,\n },\n },\n },\n {\n name: 'union',\n schema: {\n keyword: schemaKeywords.union,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n },\n {\n name: 'unionOne',\n schema: {\n keyword: schemaKeywords.union,\n args: [{ keyword: schemaKeywords.string }],\n },\n },\n {\n name: 'catchall',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.ref,\n args: { name: 'Pet', $ref: '#component/schema/Pet', path: './Pet.ts', isImportable: true },\n },\n ],\n },\n },\n },\n {\n name: 'and',\n schema: {\n keyword: schemaKeywords.and,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n },\n {\n name: 'object',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.min, args: 2 }],\n address: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.nullable }, { keyword: schemaKeywords.describe, args: '\"Your address\"' }],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectOptional',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.optional }, { keyword: schemaKeywords.min, args: 2 }],\n address: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.nullable }, { keyword: schemaKeywords.describe, args: '\"Your address\"' }],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectArray',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n ids: [\n {\n keyword: schemaKeywords.array,\n args: {\n items: [{ keyword: schemaKeywords.matches, args: '^[a-zA-Z0-9]{1,13}$' }],\n min: 3,\n max: 10,\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectDates',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n dateTime: [{ keyword: schemaKeywords.datetime, args: { offset: true } }],\n date: [{ keyword: schemaKeywords.date, args: { type: 'string' } }],\n time: [{ keyword: schemaKeywords.time, args: { type: 'string' } }],\n nativeDate: [{ keyword: schemaKeywords.date, args: { type: 'date' } }],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectAnd',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [\n { keyword: schemaKeywords.deprecated },\n { keyword: schemaKeywords.default, args: 'test' },\n {\n keyword: schemaKeywords.min,\n args: 2,\n },\n {\n keyword: schemaKeywords.string,\n },\n ],\n age: [\n { keyword: schemaKeywords.example, args: '2' },\n { keyword: schemaKeywords.default, args: 2 },\n {\n keyword: schemaKeywords.min,\n args: 3,\n },\n {\n keyword: schemaKeywords.number,\n },\n ],\n address: [\n {\n keyword: schemaKeywords.and,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n { keyword: schemaKeywords.nullable },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectEnum',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n version: [\n {\n keyword: schemaKeywords.schema,\n args: {\n format: 'string',\n type: 'string',\n },\n },\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n { name: 'C', value: 'C', format: schemaKeywords.string },\n { name: 2, value: 2, format: schemaKeywords.number },\n ],\n },\n },\n {\n keyword: schemaKeywords.min,\n args: 4,\n },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectObjectEnum',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n prop1: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n prop2: [\n {\n keyword: schemaKeywords.schema,\n args: { format: 'string', type: 'string' },\n },\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n ],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectArrayObject',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n ids: [\n {\n keyword: schemaKeywords.array,\n args: {\n items: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n enum: [\n {\n keyword: schemaKeywords.schema,\n args: {\n format: 'string',\n type: 'string',\n },\n },\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'enum',\n typeName: 'Enum',\n asConst: false,\n items: [\n { name: 'A', value: 'A', format: schemaKeywords.string },\n { name: 'B', value: 'B', format: schemaKeywords.string },\n { name: 'C', value: 'C', format: schemaKeywords.string },\n { name: 2, value: 2, format: schemaKeywords.number },\n ],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n min: 3,\n max: 10,\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n },\n {\n name: 'objectEmpty',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [],\n },\n },\n },\n {\n name: 'default',\n schema: {\n keyword: schemaKeywords.default,\n },\n },\n {\n name: 'default',\n schema: {\n keyword: schemaKeywords.default,\n args: 'default',\n },\n },\n {\n name: 'blob',\n schema: {\n keyword: schemaKeywords.blob,\n },\n },\n {\n name: 'nullableAdditionalProperties',\n schema: {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.string,\n },\n {\n args: {\n format: undefined,\n type: schemaKeywords.string,\n },\n keyword: schemaKeywords.schema,\n },\n {\n keyword: schemaKeywords.nullable,\n },\n ],\n },\n },\n },\n]\n\nconst full: Array<{ name: string; schema: Schema[] }> = [\n {\n name: 'Upload',\n schema: [\n {\n keyword: schemaKeywords.blob,\n },\n ],\n },\n {\n name: 'PageSizeNumber',\n schema: [\n {\n keyword: schemaKeywords.number,\n },\n {\n keyword: schemaKeywords.default,\n args: 10,\n },\n ],\n },\n {\n name: 'PageSizeInteger',\n schema: [\n {\n keyword: schemaKeywords.integer,\n },\n {\n keyword: schemaKeywords.default,\n args: 10,\n },\n ],\n },\n {\n name: 'Object',\n schema: [\n { keyword: schemaKeywords.nullable },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n firstName: [\n { keyword: schemaKeywords.deprecated },\n { keyword: schemaKeywords.default, args: 'test' },\n {\n keyword: schemaKeywords.min,\n args: 2,\n },\n {\n keyword: schemaKeywords.string,\n },\n ],\n age: [\n { keyword: schemaKeywords.example, args: '2' },\n { keyword: schemaKeywords.default, args: 2 },\n {\n keyword: schemaKeywords.min,\n args: 2,\n },\n {\n keyword: schemaKeywords.number,\n },\n ],\n address: [\n {\n keyword: schemaKeywords.and,\n args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }],\n },\n { keyword: schemaKeywords.nullable },\n { keyword: schemaKeywords.describe, args: 'Your address' },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n },\n {\n name: 'Order',\n schema: [\n {\n keyword: schemaKeywords.schema,\n args: {\n type: 'object',\n },\n },\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n status: [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: 'orderStatus',\n asConst: false,\n typeName: 'OrderStatus',\n items: [\n { name: 'Placed', value: 'placed', format: 'string' },\n { name: 'Approved', value: 'approved', format: 'string' },\n ],\n },\n },\n ],\n },\n additionalProperties: [],\n },\n },\n ],\n },\n {\n name: 'nullableAdditionalProperties',\n schema: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.string,\n },\n {\n args: {\n format: undefined,\n type: schemaKeywords.string,\n },\n keyword: schemaKeywords.schema,\n },\n {\n keyword: schemaKeywords.number,\n },\n ],\n },\n },\n ],\n },\n {\n name: 'Record',\n schema: [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {},\n additionalProperties: [\n {\n keyword: schemaKeywords.integer,\n },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: 'integer',\n format: 'int32',\n },\n },\n {\n keyword: schemaKeywords.optional,\n },\n ],\n },\n },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: 'integer',\n format: 'int32',\n },\n },\n {\n keyword: schemaKeywords.optional,\n },\n ],\n },\n]\n\nexport const schemas = {\n basic,\n full,\n}\n"],"mappings":";;;AAEA,MAAMA,QAAiD;CACrD;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe,KACzB;EACF;CACD;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe,SACzB;EACF;CACD;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe,QACzB;EACF;CACD;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe,QACzB;EACF;CACD;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe,SACzB;EACF;CACD;EACE,MAAM;EACN,QAAQ,EACN,SAAS,eAAe,SACzB;EACF;CACD;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,MAAM,QACP;GACF;EACF;CACD;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,MAAM,UACP;GACF;EACF;CACD;EACE,MAAM;EACN,QAAQ;GACN,SAAS,eAAe;GACxB,MAAM,EACJ,MAAM,UACP;GACF;EACF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AAM;OAAU,OAAO;OAAU,QAAQ;OAAU,EACrD;OAAE,MAAM;OAAY,OAAO;OAAY,QAAQ;OAAU,CAC1D;MACF;KACF,CACF,EACF;IACD,sBAAsB,EAAE;IACzB;GACF,CACF;EACF;CACD;EACE,MAAM;EACN,QAAQ,CACN;GACE,SAAS,eAAe;GACxB,MAAM;IACJ,YAAY,EAAE;IACd,sBAAsB;KACpB,EACE,SAAS,eAAe,QACzB;KACD;MACE,MAAM;OACJ,QAAQ;OACR,MAAM,eAAe;OACtB;MACD,SAAS,eAAe;MACzB;KACD,EACE,SAAS,eAAe,QACzB;KACF;IACF;GACF,CACF;EACF;CACD;EACE,MAAM;EACN,QAAQ;GACN;IACE,SAAS,eAAe;IACxB,MAAM;KACJ,YAAY,EAAE;KACd,sBAAsB;MACpB,EACE,SAAS,eAAe,SACzB;MACD;OACE,SAAS,eAAe;OACxB,MAAM;QACJ,MAAM;QACN,QAAQ;QACT;OACF;MACD,EACE,SAAS,eAAe,UACzB;MACF;KACF;IACF;GACD;IACE,SAAS,eAAe;IACxB,MAAM;KACJ,MAAM;KACN,QAAQ;KACT;IACF;GACD,EACE,SAAS,eAAe,UACzB;GACF;EACF;CACF;AAED,MAAa,UAAU;CACrB;CACA;CACD"}
@@ -1,8 +1,12 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const node_path = require_chunk.__toESM(require("node:path"));
3
- const __kubb_core_utils = require_chunk.__toESM(require("@kubb/core/utils"));
4
- const __kubb_oas = require_chunk.__toESM(require("@kubb/oas"));
5
- const __stoplight_yaml = require_chunk.__toESM(require("@stoplight/yaml"));
2
+ let node_path = require("node:path");
3
+ node_path = require_chunk.__toESM(node_path);
4
+ let __kubb_core_utils = require("@kubb/core/utils");
5
+ __kubb_core_utils = require_chunk.__toESM(__kubb_core_utils);
6
+ let __kubb_oas = require("@kubb/oas");
7
+ __kubb_oas = require_chunk.__toESM(__kubb_oas);
8
+ let __stoplight_yaml = require("@stoplight/yaml");
9
+ __stoplight_yaml = require_chunk.__toESM(__stoplight_yaml);
6
10
 
7
11
  //#region src/utils/parseFromConfig.ts
8
12
  function parseFromConfig(config, oasClass = __kubb_oas.Oas) {
@@ -30,4 +34,4 @@ Object.defineProperty(exports, 'parseFromConfig', {
30
34
  return parseFromConfig;
31
35
  }
32
36
  });
33
- //# sourceMappingURL=parseFromConfig-CMNGsef2.cjs.map
37
+ //# sourceMappingURL=parseFromConfig-CFzprC8B.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseFromConfig-CMNGsef2.cjs","names":["Oas","api: OasTypes.OASDocument","api","api: string","yaml","URLPath"],"sources":["../src/utils/parseFromConfig.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { URLPath } from '@kubb/core/utils'\n\nimport { merge, parse } from '@kubb/oas'\n\nimport type { Config } from '@kubb/core'\nimport { Oas, type OasTypes } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, { oasClass })\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, { oasClass })\n } catch (_e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, { oasClass })\n }\n\n if (Array.isArray(config.input)) {\n return merge(\n config.input.map((input) => input.path),\n { oasClass },\n )\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, { oasClass })\n }\n\n return parse(resolve(config.root, config.input.path), { oasClass })\n}\n"],"mappings":";;;;;;;AAUA,SAAgB,gBAAgB,QAAgB,WAAuBA,gBAAmB;AACxF,KAAI,UAAU,OAAO,OAAO;AAC1B,MAAI,OAAO,OAAO,MAAM,SAAS,UAAU;GACzC,MAAMC,QAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM;AACzE,gCAAaC,OAAK,EAAE;;AAGtB,MAAI;GACF,MAAMC,QAAcC,yBAAK,MAAM,OAAO,MAAM;AAE5C,gCAAaF,OAAK,EAAE;WACb,IAAI;EAIb,MAAMD,MAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM;AAEzE,+BAAa,KAAK,EAAE;;AAGtB,KAAI,MAAM,QAAQ,OAAO,OACvB,8BACE,OAAO,MAAM,KAAK,UAAU,MAAM,OAClC,EAAE;AAIN,KAAI,IAAII,0BAAQ,OAAO,MAAM,MAAM,MACjC,8BAAa,OAAO,MAAM,MAAM,EAAE;AAGpC,qDAAqB,OAAO,MAAM,OAAO,MAAM,OAAO,EAAE"}
1
+ {"version":3,"file":"parseFromConfig-CFzprC8B.cjs","names":["Oas","api: OasTypes.OASDocument","api","api: string","yaml","URLPath"],"sources":["../src/utils/parseFromConfig.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { URLPath } from '@kubb/core/utils'\n\nimport { merge, parse } from '@kubb/oas'\n\nimport type { Config } from '@kubb/core'\nimport { Oas, type OasTypes } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, { oasClass })\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, { oasClass })\n } catch (_e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, { oasClass })\n }\n\n if (Array.isArray(config.input)) {\n return merge(\n config.input.map((input) => input.path),\n { oasClass },\n )\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, { oasClass })\n }\n\n return parse(resolve(config.root, config.input.path), { oasClass })\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgB,gBAAgB,QAAgB,WAAuBA,gBAAmB;AACxF,KAAI,UAAU,OAAO,OAAO;AAC1B,MAAI,OAAO,OAAO,MAAM,SAAS,UAAU;GACzC,MAAMC,QAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC;AAC/E,gCAAaC,OAAK,EAAE,UAAU,CAAC;;AAGjC,MAAI;GACF,MAAMC,QAAcC,yBAAK,MAAM,OAAO,MAAM,KAAe;AAE3D,gCAAaF,OAAK,EAAE,UAAU,CAAC;WACxB,IAAI;EAIb,MAAMD,MAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC;AAE/E,+BAAa,KAAK,EAAE,UAAU,CAAC;;AAGjC,KAAI,MAAM,QAAQ,OAAO,MAAM,CAC7B,8BACE,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,EACvC,EAAE,UAAU,CACb;AAGH,KAAI,IAAII,0BAAQ,OAAO,MAAM,KAAK,CAAC,MACjC,8BAAa,OAAO,MAAM,MAAM,EAAE,UAAU,CAAC;AAG/C,qDAAqB,OAAO,MAAM,OAAO,MAAM,KAAK,EAAE,EAAE,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseFromConfig-yAiFK03V.js","names":["api: OasTypes.OASDocument","api","api: string"],"sources":["../src/utils/parseFromConfig.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { URLPath } from '@kubb/core/utils'\n\nimport { merge, parse } from '@kubb/oas'\n\nimport type { Config } from '@kubb/core'\nimport { Oas, type OasTypes } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, { oasClass })\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, { oasClass })\n } catch (_e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, { oasClass })\n }\n\n if (Array.isArray(config.input)) {\n return merge(\n config.input.map((input) => input.path),\n { oasClass },\n )\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, { oasClass })\n }\n\n return parse(resolve(config.root, config.input.path), { oasClass })\n}\n"],"mappings":";;;;;;AAUA,SAAgB,gBAAgB,QAAgB,WAAuB,KAAmB;AACxF,KAAI,UAAU,OAAO,OAAO;AAC1B,MAAI,OAAO,OAAO,MAAM,SAAS,UAAU;GACzC,MAAMA,QAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM;AACzE,UAAO,MAAMC,OAAK,EAAE;;AAGtB,MAAI;GACF,MAAMC,QAAc,KAAK,MAAM,OAAO,MAAM;AAE5C,UAAO,MAAMD,OAAK,EAAE;WACb,IAAI;EAIb,MAAMD,MAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM;AAEzE,SAAO,MAAM,KAAK,EAAE;;AAGtB,KAAI,MAAM,QAAQ,OAAO,OACvB,QAAO,MACL,OAAO,MAAM,KAAK,UAAU,MAAM,OAClC,EAAE;AAIN,KAAI,IAAI,QAAQ,OAAO,MAAM,MAAM,MACjC,QAAO,MAAM,OAAO,MAAM,MAAM,EAAE;AAGpC,QAAO,MAAM,QAAQ,OAAO,MAAM,OAAO,MAAM,OAAO,EAAE"}
1
+ {"version":3,"file":"parseFromConfig-yAiFK03V.js","names":["api: OasTypes.OASDocument","api","api: string"],"sources":["../src/utils/parseFromConfig.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { URLPath } from '@kubb/core/utils'\n\nimport { merge, parse } from '@kubb/oas'\n\nimport type { Config } from '@kubb/core'\nimport { Oas, type OasTypes } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, { oasClass })\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, { oasClass })\n } catch (_e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, { oasClass })\n }\n\n if (Array.isArray(config.input)) {\n return merge(\n config.input.map((input) => input.path),\n { oasClass },\n )\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, { oasClass })\n }\n\n return parse(resolve(config.root, config.input.path), { oasClass })\n}\n"],"mappings":";;;;;;AAUA,SAAgB,gBAAgB,QAAgB,WAAuB,KAAmB;AACxF,KAAI,UAAU,OAAO,OAAO;AAC1B,MAAI,OAAO,OAAO,MAAM,SAAS,UAAU;GACzC,MAAMA,QAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC;AAC/E,UAAO,MAAMC,OAAK,EAAE,UAAU,CAAC;;AAGjC,MAAI;GACF,MAAMC,QAAc,KAAK,MAAM,OAAO,MAAM,KAAe;AAE3D,UAAO,MAAMD,OAAK,EAAE,UAAU,CAAC;WACxB,IAAI;EAIb,MAAMD,MAA4B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC;AAE/E,SAAO,MAAM,KAAK,EAAE,UAAU,CAAC;;AAGjC,KAAI,MAAM,QAAQ,OAAO,MAAM,CAC7B,QAAO,MACL,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,EACvC,EAAE,UAAU,CACb;AAGH,KAAI,IAAI,QAAQ,OAAO,MAAM,KAAK,CAAC,MACjC,QAAO,MAAM,OAAO,MAAM,MAAM,EAAE,UAAU,CAAC;AAG/C,QAAO,MAAM,QAAQ,OAAO,MAAM,OAAO,MAAM,KAAK,EAAE,EAAE,UAAU,CAAC"}
package/dist/utils.cjs CHANGED
@@ -1,10 +1,13 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_getFooter = require('./getFooter-BChY2kC1.cjs');
3
- const require_getSchemas = require('./getSchemas-D8mP129c.cjs');
4
- const require_parseFromConfig = require('./parseFromConfig-CMNGsef2.cjs');
5
- const __kubb_core_transformers = require_chunk.__toESM(require("@kubb/core/transformers"));
6
- const __kubb_core_utils = require_chunk.__toESM(require("@kubb/core/utils"));
7
- const __kubb_oas = require_chunk.__toESM(require("@kubb/oas"));
2
+ const require_getFooter = require('./getFooter-B_nmsoeK.cjs');
3
+ const require_getSchemas = require('./getSchemas-08CU8KWq.cjs');
4
+ const require_parseFromConfig = require('./parseFromConfig-CFzprC8B.cjs');
5
+ let __kubb_core_transformers = require("@kubb/core/transformers");
6
+ __kubb_core_transformers = require_chunk.__toESM(__kubb_core_transformers);
7
+ let __kubb_core_utils = require("@kubb/core/utils");
8
+ __kubb_core_utils = require_chunk.__toESM(__kubb_core_utils);
9
+ let __kubb_oas = require("@kubb/oas");
10
+ __kubb_oas = require_chunk.__toESM(__kubb_oas);
8
11
 
9
12
  //#region src/utils/getComments.ts
10
13
  function getComments(operation) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","names":["URLPath","transformers","data: FunctionParamsAST"],"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport { URLPath } from '@kubb/core/utils'\n\nimport type { Operation } from '@kubb/oas'\n\nexport function getComments(operation: Operation): string[] {\n return [\n operation.getDescription() && `@description ${operation.getDescription()}`,\n operation.getSummary() && `@summary ${operation.getSummary()}`,\n operation.path && `{@link ${new URLPath(operation.path).URL}}`,\n operation.isDeprecated() && '@deprecated',\n ]\n .filter(Boolean)\n .map((text) => transformers.trim(text))\n}\n","import { isParameterObject } from '@kubb/oas'\n\nimport { camelCase, isValidVarName } from '@kubb/core/transformers'\nimport type { FunctionParamsAST } from '@kubb/core/utils'\nimport type { OasTypes } from '@kubb/oas'\nimport type { Params } from '@kubb/react/types'\nimport type { OperationSchema } from '../types.ts'\n/**\n *\n * @deprecated\n * TODO move to operationManager hook\n */\nexport function getASTParams(\n operationSchema: OperationSchema | undefined,\n {\n typed = false,\n override,\n }: {\n typed?: boolean\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n): FunctionParamsAST[] {\n if (!operationSchema || !operationSchema.schema.properties || !operationSchema.name) {\n return []\n }\n\n return Object.entries(operationSchema.schema.properties).map(([name, schema]: [string, OasTypes.SchemaObject]) => {\n const isParam = isParameterObject(schema)\n const data: FunctionParamsAST = {\n name,\n enabled: !!name,\n required: isParam ? schema.required : true,\n type: typed ? `${operationSchema.name}[\"${name}\"]` : undefined,\n }\n\n return override ? override(data) : data\n })\n}\n\nexport function getPathParams(\n operationSchema: OperationSchema | undefined,\n options: {\n typed?: boolean\n casing?: 'camelcase'\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n) {\n return getASTParams(operationSchema, options).reduce((acc, curr) => {\n if (curr.name && curr.enabled) {\n let name = isValidVarName(curr.name) ? curr.name : camelCase(curr.name)\n\n if (options.casing === 'camelcase') {\n name = camelCase(name)\n }\n\n acc[name] = {\n default: curr.default,\n type: curr.type,\n optional: !curr.required,\n }\n }\n\n return acc\n }, {} as Params)\n}\n"],"mappings":";;;;;;;;;AAKA,SAAgB,YAAY,WAAgC;AAC1D,QAAO;EACL,UAAU,oBAAoB,gBAAgB,UAAU;EACxD,UAAU,gBAAgB,YAAY,UAAU;EAChD,UAAU,QAAQ,UAAU,IAAIA,0BAAQ,UAAU,MAAM,IAAI;EAC5D,UAAU,kBAAkB;GAE3B,OAAO,SACP,KAAK,SAASC,iCAAa,KAAK;;;;;;;;;;ACDrC,SAAgB,aACd,iBACA,EACE,QAAQ,OACR,aAIE,IACiB;AACrB,KAAI,CAAC,mBAAmB,CAAC,gBAAgB,OAAO,cAAc,CAAC,gBAAgB,KAC7E,QAAO;AAGT,QAAO,OAAO,QAAQ,gBAAgB,OAAO,YAAY,KAAK,CAAC,MAAM,YAA6C;EAChH,MAAM,4CAA4B;EAClC,MAAMC,OAA0B;GAC9B;GACA,SAAS,CAAC,CAAC;GACX,UAAU,UAAU,OAAO,WAAW;GACtC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,IAAI,KAAK,MAAM;;AAGvD,SAAO,WAAW,SAAS,QAAQ;;;AAIvC,SAAgB,cACd,iBACA,UAII,IACJ;AACA,QAAO,aAAa,iBAAiB,SAAS,QAAQ,KAAK,SAAS;AAClE,MAAI,KAAK,QAAQ,KAAK,SAAS;GAC7B,IAAI,oDAAsB,KAAK,QAAQ,KAAK,+CAAiB,KAAK;AAElE,OAAI,QAAQ,WAAW,YACrB,gDAAiB;AAGnB,OAAI,QAAQ;IACV,SAAS,KAAK;IACd,MAAM,KAAK;IACX,UAAU,CAAC,KAAK;;;AAIpB,SAAO;IACN"}
1
+ {"version":3,"file":"utils.cjs","names":["URLPath","transformers","data: FunctionParamsAST"],"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport { URLPath } from '@kubb/core/utils'\n\nimport type { Operation } from '@kubb/oas'\n\nexport function getComments(operation: Operation): string[] {\n return [\n operation.getDescription() && `@description ${operation.getDescription()}`,\n operation.getSummary() && `@summary ${operation.getSummary()}`,\n operation.path && `{@link ${new URLPath(operation.path).URL}}`,\n operation.isDeprecated() && '@deprecated',\n ]\n .filter(Boolean)\n .map((text) => transformers.trim(text))\n}\n","import { isParameterObject } from '@kubb/oas'\n\nimport { camelCase, isValidVarName } from '@kubb/core/transformers'\nimport type { FunctionParamsAST } from '@kubb/core/utils'\nimport type { OasTypes } from '@kubb/oas'\nimport type { Params } from '@kubb/react/types'\nimport type { OperationSchema } from '../types.ts'\n/**\n *\n * @deprecated\n * TODO move to operationManager hook\n */\nexport function getASTParams(\n operationSchema: OperationSchema | undefined,\n {\n typed = false,\n override,\n }: {\n typed?: boolean\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n): FunctionParamsAST[] {\n if (!operationSchema || !operationSchema.schema.properties || !operationSchema.name) {\n return []\n }\n\n return Object.entries(operationSchema.schema.properties).map(([name, schema]: [string, OasTypes.SchemaObject]) => {\n const isParam = isParameterObject(schema)\n const data: FunctionParamsAST = {\n name,\n enabled: !!name,\n required: isParam ? schema.required : true,\n type: typed ? `${operationSchema.name}[\"${name}\"]` : undefined,\n }\n\n return override ? override(data) : data\n })\n}\n\nexport function getPathParams(\n operationSchema: OperationSchema | undefined,\n options: {\n typed?: boolean\n casing?: 'camelcase'\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n) {\n return getASTParams(operationSchema, options).reduce((acc, curr) => {\n if (curr.name && curr.enabled) {\n let name = isValidVarName(curr.name) ? curr.name : camelCase(curr.name)\n\n if (options.casing === 'camelcase') {\n name = camelCase(name)\n }\n\n acc[name] = {\n default: curr.default,\n type: curr.type,\n optional: !curr.required,\n }\n }\n\n return acc\n }, {} as Params)\n}\n"],"mappings":";;;;;;;;;;;;AAKA,SAAgB,YAAY,WAAgC;AAC1D,QAAO;EACL,UAAU,gBAAgB,IAAI,gBAAgB,UAAU,gBAAgB;EACxE,UAAU,YAAY,IAAI,YAAY,UAAU,YAAY;EAC5D,UAAU,QAAQ,UAAU,IAAIA,0BAAQ,UAAU,KAAK,CAAC,IAAI;EAC5D,UAAU,cAAc,IAAI;EAC7B,CACE,OAAO,QAAQ,CACf,KAAK,SAASC,iCAAa,KAAK,KAAK,CAAC;;;;;;;;;;ACD3C,SAAgB,aACd,iBACA,EACE,QAAQ,OACR,aAIE,EAAE,EACe;AACrB,KAAI,CAAC,mBAAmB,CAAC,gBAAgB,OAAO,cAAc,CAAC,gBAAgB,KAC7E,QAAO,EAAE;AAGX,QAAO,OAAO,QAAQ,gBAAgB,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,YAA6C;EAChH,MAAM,4CAA4B,OAAO;EACzC,MAAMC,OAA0B;GAC9B;GACA,SAAS,CAAC,CAAC;GACX,UAAU,UAAU,OAAO,WAAW;GACtC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,IAAI,KAAK,MAAM;GACtD;AAED,SAAO,WAAW,SAAS,KAAK,GAAG;GACnC;;AAGJ,SAAgB,cACd,iBACA,UAII,EAAE,EACN;AACA,QAAO,aAAa,iBAAiB,QAAQ,CAAC,QAAQ,KAAK,SAAS;AAClE,MAAI,KAAK,QAAQ,KAAK,SAAS;GAC7B,IAAI,oDAAsB,KAAK,KAAK,GAAG,KAAK,+CAAiB,KAAK,KAAK;AAEvE,OAAI,QAAQ,WAAW,YACrB,gDAAiB,KAAK;AAGxB,OAAI,QAAQ;IACV,SAAS,KAAK;IACd,MAAM,KAAK;IACX,UAAU,CAAC,KAAK;IACjB;;AAGH,SAAO;IACN,EAAE,CAAW"}
package/dist/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getBanner, getFooter } from "./getFooter-T7_pZ6f8.js";
1
+ import { getBanner, getFooter } from "./getFooter-DM8B8cnC.js";
2
2
  import { getSchemaFactory, getSchemas } from "./getSchemas-WoSBIxG8.js";
3
3
  import { parseFromConfig } from "./parseFromConfig-yAiFK03V.js";
4
4
  import transformers, { camelCase, isValidVarName } from "@kubb/core/transformers";
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["data: FunctionParamsAST"],"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport { URLPath } from '@kubb/core/utils'\n\nimport type { Operation } from '@kubb/oas'\n\nexport function getComments(operation: Operation): string[] {\n return [\n operation.getDescription() && `@description ${operation.getDescription()}`,\n operation.getSummary() && `@summary ${operation.getSummary()}`,\n operation.path && `{@link ${new URLPath(operation.path).URL}}`,\n operation.isDeprecated() && '@deprecated',\n ]\n .filter(Boolean)\n .map((text) => transformers.trim(text))\n}\n","import { isParameterObject } from '@kubb/oas'\n\nimport { camelCase, isValidVarName } from '@kubb/core/transformers'\nimport type { FunctionParamsAST } from '@kubb/core/utils'\nimport type { OasTypes } from '@kubb/oas'\nimport type { Params } from '@kubb/react/types'\nimport type { OperationSchema } from '../types.ts'\n/**\n *\n * @deprecated\n * TODO move to operationManager hook\n */\nexport function getASTParams(\n operationSchema: OperationSchema | undefined,\n {\n typed = false,\n override,\n }: {\n typed?: boolean\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n): FunctionParamsAST[] {\n if (!operationSchema || !operationSchema.schema.properties || !operationSchema.name) {\n return []\n }\n\n return Object.entries(operationSchema.schema.properties).map(([name, schema]: [string, OasTypes.SchemaObject]) => {\n const isParam = isParameterObject(schema)\n const data: FunctionParamsAST = {\n name,\n enabled: !!name,\n required: isParam ? schema.required : true,\n type: typed ? `${operationSchema.name}[\"${name}\"]` : undefined,\n }\n\n return override ? override(data) : data\n })\n}\n\nexport function getPathParams(\n operationSchema: OperationSchema | undefined,\n options: {\n typed?: boolean\n casing?: 'camelcase'\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n) {\n return getASTParams(operationSchema, options).reduce((acc, curr) => {\n if (curr.name && curr.enabled) {\n let name = isValidVarName(curr.name) ? curr.name : camelCase(curr.name)\n\n if (options.casing === 'camelcase') {\n name = camelCase(name)\n }\n\n acc[name] = {\n default: curr.default,\n type: curr.type,\n optional: !curr.required,\n }\n }\n\n return acc\n }, {} as Params)\n}\n"],"mappings":";;;;;;;;AAKA,SAAgB,YAAY,WAAgC;AAC1D,QAAO;EACL,UAAU,oBAAoB,gBAAgB,UAAU;EACxD,UAAU,gBAAgB,YAAY,UAAU;EAChD,UAAU,QAAQ,UAAU,IAAI,QAAQ,UAAU,MAAM,IAAI;EAC5D,UAAU,kBAAkB;GAE3B,OAAO,SACP,KAAK,SAAS,aAAa,KAAK;;;;;;;;;;ACDrC,SAAgB,aACd,iBACA,EACE,QAAQ,OACR,aAIE,IACiB;AACrB,KAAI,CAAC,mBAAmB,CAAC,gBAAgB,OAAO,cAAc,CAAC,gBAAgB,KAC7E,QAAO;AAGT,QAAO,OAAO,QAAQ,gBAAgB,OAAO,YAAY,KAAK,CAAC,MAAM,YAA6C;EAChH,MAAM,UAAU,kBAAkB;EAClC,MAAMA,OAA0B;GAC9B;GACA,SAAS,CAAC,CAAC;GACX,UAAU,UAAU,OAAO,WAAW;GACtC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,IAAI,KAAK,MAAM;;AAGvD,SAAO,WAAW,SAAS,QAAQ;;;AAIvC,SAAgB,cACd,iBACA,UAII,IACJ;AACA,QAAO,aAAa,iBAAiB,SAAS,QAAQ,KAAK,SAAS;AAClE,MAAI,KAAK,QAAQ,KAAK,SAAS;GAC7B,IAAI,OAAO,eAAe,KAAK,QAAQ,KAAK,OAAO,UAAU,KAAK;AAElE,OAAI,QAAQ,WAAW,YACrB,QAAO,UAAU;AAGnB,OAAI,QAAQ;IACV,SAAS,KAAK;IACd,MAAM,KAAK;IACX,UAAU,CAAC,KAAK;;;AAIpB,SAAO;IACN"}
1
+ {"version":3,"file":"utils.js","names":["data: FunctionParamsAST"],"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport { URLPath } from '@kubb/core/utils'\n\nimport type { Operation } from '@kubb/oas'\n\nexport function getComments(operation: Operation): string[] {\n return [\n operation.getDescription() && `@description ${operation.getDescription()}`,\n operation.getSummary() && `@summary ${operation.getSummary()}`,\n operation.path && `{@link ${new URLPath(operation.path).URL}}`,\n operation.isDeprecated() && '@deprecated',\n ]\n .filter(Boolean)\n .map((text) => transformers.trim(text))\n}\n","import { isParameterObject } from '@kubb/oas'\n\nimport { camelCase, isValidVarName } from '@kubb/core/transformers'\nimport type { FunctionParamsAST } from '@kubb/core/utils'\nimport type { OasTypes } from '@kubb/oas'\nimport type { Params } from '@kubb/react/types'\nimport type { OperationSchema } from '../types.ts'\n/**\n *\n * @deprecated\n * TODO move to operationManager hook\n */\nexport function getASTParams(\n operationSchema: OperationSchema | undefined,\n {\n typed = false,\n override,\n }: {\n typed?: boolean\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n): FunctionParamsAST[] {\n if (!operationSchema || !operationSchema.schema.properties || !operationSchema.name) {\n return []\n }\n\n return Object.entries(operationSchema.schema.properties).map(([name, schema]: [string, OasTypes.SchemaObject]) => {\n const isParam = isParameterObject(schema)\n const data: FunctionParamsAST = {\n name,\n enabled: !!name,\n required: isParam ? schema.required : true,\n type: typed ? `${operationSchema.name}[\"${name}\"]` : undefined,\n }\n\n return override ? override(data) : data\n })\n}\n\nexport function getPathParams(\n operationSchema: OperationSchema | undefined,\n options: {\n typed?: boolean\n casing?: 'camelcase'\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n) {\n return getASTParams(operationSchema, options).reduce((acc, curr) => {\n if (curr.name && curr.enabled) {\n let name = isValidVarName(curr.name) ? curr.name : camelCase(curr.name)\n\n if (options.casing === 'camelcase') {\n name = camelCase(name)\n }\n\n acc[name] = {\n default: curr.default,\n type: curr.type,\n optional: !curr.required,\n }\n }\n\n return acc\n }, {} as Params)\n}\n"],"mappings":";;;;;;;;AAKA,SAAgB,YAAY,WAAgC;AAC1D,QAAO;EACL,UAAU,gBAAgB,IAAI,gBAAgB,UAAU,gBAAgB;EACxE,UAAU,YAAY,IAAI,YAAY,UAAU,YAAY;EAC5D,UAAU,QAAQ,UAAU,IAAI,QAAQ,UAAU,KAAK,CAAC,IAAI;EAC5D,UAAU,cAAc,IAAI;EAC7B,CACE,OAAO,QAAQ,CACf,KAAK,SAAS,aAAa,KAAK,KAAK,CAAC;;;;;;;;;;ACD3C,SAAgB,aACd,iBACA,EACE,QAAQ,OACR,aAIE,EAAE,EACe;AACrB,KAAI,CAAC,mBAAmB,CAAC,gBAAgB,OAAO,cAAc,CAAC,gBAAgB,KAC7E,QAAO,EAAE;AAGX,QAAO,OAAO,QAAQ,gBAAgB,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,YAA6C;EAChH,MAAM,UAAU,kBAAkB,OAAO;EACzC,MAAMA,OAA0B;GAC9B;GACA,SAAS,CAAC,CAAC;GACX,UAAU,UAAU,OAAO,WAAW;GACtC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,IAAI,KAAK,MAAM;GACtD;AAED,SAAO,WAAW,SAAS,KAAK,GAAG;GACnC;;AAGJ,SAAgB,cACd,iBACA,UAII,EAAE,EACN;AACA,QAAO,aAAa,iBAAiB,QAAQ,CAAC,QAAQ,KAAK,SAAS;AAClE,MAAI,KAAK,QAAQ,KAAK,SAAS;GAC7B,IAAI,OAAO,eAAe,KAAK,KAAK,GAAG,KAAK,OAAO,UAAU,KAAK,KAAK;AAEvE,OAAI,QAAQ,WAAW,YACrB,QAAO,UAAU,KAAK;AAGxB,OAAI,QAAQ;IACV,SAAS,KAAK;IACd,MAAM,KAAK;IACX,UAAU,CAAC,KAAK;IACjB;;AAGH,SAAO;IACN,EAAE,CAAW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-oas",
3
- "version": "3.18.3",
3
+ "version": "4.0.0",
4
4
  "description": "OpenAPI Specification (OAS) plugin for Kubb, providing core functionality for parsing and processing OpenAPI/Swagger schemas for code generation.",
5
5
  "keywords": [
6
6
  "openapi",
@@ -81,20 +81,20 @@
81
81
  "dependencies": {
82
82
  "@stoplight/yaml": "^4.3.0",
83
83
  "p-limit": "^7.1.1",
84
- "remeda": "^2.30.0",
85
- "@kubb/core": "3.18.3",
86
- "@kubb/oas": "3.18.3",
87
- "@kubb/react": "3.18.3"
84
+ "remeda": "^2.32.0",
85
+ "@kubb/core": "4.0.0",
86
+ "@kubb/oas": "4.0.0",
87
+ "@kubb/react": "4.0.0"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@types/react": "^18.3.24",
91
91
  "react": "^18.3.1",
92
92
  "tsdown": "^0.14.2",
93
93
  "typescript": "^5.9.2",
94
- "@kubb/config-ts": "3.18.3"
94
+ "@kubb/config-ts": "4.0.0"
95
95
  },
96
96
  "peerDependencies": {
97
- "@kubb/react": "^3.0.0"
97
+ "@kubb/react": "^4.0.0"
98
98
  },
99
99
  "engines": {
100
100
  "node": ">=20"
@@ -264,12 +264,6 @@ export class SchemaGenerator<
264
264
  })
265
265
  }
266
266
 
267
- #getUsedEnumNames(props: SchemaProps) {
268
- const options = this.#getOptions(props)
269
-
270
- return options.usedEnumNames || {}
271
- }
272
-
273
267
  #getOptions({ name }: SchemaProps): Partial<TOptions> {
274
268
  const { override = [] } = this.context
275
269
 
@@ -743,7 +737,7 @@ export class SchemaGenerator<
743
737
  this.context.pluginManager.logger.emit('info', 'EnumSuffix set to an empty string does not work')
744
738
  }
745
739
 
746
- const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(' ')), this.#getUsedEnumNames({ schemaObject, name }))
740
+ const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(' ')), this.context.plugin.context?.usedEnumNames || {})
747
741
  const typeName = this.context.pluginManager.resolveName({
748
742
  name: enumName,
749
743
  pluginKey: this.context.plugin.key,
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaGenerator-WslcpOxc.js","names":["#head","#tail","#size","#getOptions","#parseSchemaObject","foundItems: SchemaKeywordMapper[T][]","foundItem: SchemaKeywordMapper[T] | undefined","mergedProperties: Record<string, Schema[]> | null","mergedAdditionalProps: Schema[]","newArgs: Schema[]","validationFunctions: Schema[]","additionalPropertiesSchemas: Schema[]","#getUnknownType","#usedAliasNames","#getRefAlias","#getParsedSchemaObject","#getEmptyType","baseItems: Schema[]","union: SchemaKeywordMapper['union']","#addDiscriminatorToSchema","and: Schema","resolvedSchemas: SchemaObject[]","parsedItems: SchemaObject[]","#getUsedEnumNames","name","min","max","#parseProperties"],"sources":["../../../node_modules/.pnpm/yocto-queue@1.2.1/node_modules/yocto-queue/index.js","../../../node_modules/.pnpm/p-limit@7.1.1/node_modules/p-limit/index.js","../src/SchemaGenerator.ts"],"sourcesContent":["/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tpeek() {\n\t\tif (!this.#head) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.#head.value;\n\n\t\t// TODO: Node.js 18.\n\t\t// return this.#head?.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n\n\t* drain() {\n\t\twhile (this.#head) {\n\t\t\tyield this.dequeue();\n\t\t}\n\t}\n}\n","import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tvalidateConcurrency(concurrency);\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst resumeNext = () => {\n\t\t// Process the next queued function if we're under the concurrency limit\n\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\tactiveCount++;\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst next = () => {\n\t\tactiveCount--;\n\t\tresumeNext();\n\t};\n\n\tconst run = async (function_, resolve, arguments_) => {\n\t\t// Execute the function and capture the result promise\n\t\tconst result = (async () => function_(...arguments_))();\n\n\t\t// Resolve immediately with the promise (don't wait for completion)\n\t\tresolve(result);\n\n\t\t// Wait for the function to complete (success or failure)\n\t\t// We catch errors here to prevent unhandled rejections,\n\t\t// but the original promise rejection is preserved for the caller\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\t// Decrement active count and process next queued function\n\t\tnext();\n\t};\n\n\tconst enqueue = (function_, resolve, arguments_) => {\n\t\t// Queue the internal resolve function instead of the run function\n\t\t// to preserve the asynchronous execution context.\n\t\tnew Promise(internalResolve => { // eslint-disable-line promise/param-names\n\t\t\tqueue.enqueue(internalResolve);\n\t\t}).then(run.bind(undefined, function_, resolve, arguments_)); // eslint-disable-line promise/prefer-await-to-then\n\n\t\t// Start processing immediately if we haven't reached the concurrency limit\n\t\tif (activeCount < concurrency) {\n\t\t\tresumeNext();\n\t\t}\n\t};\n\n\tconst generator = (function_, ...arguments_) => new Promise(resolve => {\n\t\tenqueue(function_, resolve, arguments_);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue() {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t\tconcurrency: {\n\t\t\tget: () => concurrency,\n\n\t\t\tset(newConcurrency) {\n\t\t\t\tvalidateConcurrency(newConcurrency);\n\t\t\t\tconcurrency = newConcurrency;\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\twhile (activeCount < concurrency && queue.size > 0) {\n\t\t\t\t\t\tresumeNext();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t},\n\t\tmap: {\n\t\t\tasync value(array, function_) {\n\t\t\t\tconst promises = array.map((value, index) => this(function_, value, index));\n\t\t\t\treturn Promise.all(promises);\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n\nexport function limitFunction(function_, options) {\n\tconst {concurrency} = options;\n\tconst limit = pLimit(concurrency);\n\n\treturn (...arguments_) => limit(() => function_(...arguments_));\n}\n\nfunction validateConcurrency(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n}\n","import type { Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from '@kubb/core'\nimport { BaseGenerator, type FileMetaBase } from '@kubb/core'\nimport type { KubbFile } from '@kubb/core/fs'\nimport transformers, { pascalCase } from '@kubb/core/transformers'\nimport { getUniqueName } from '@kubb/core/utils'\nimport type { contentType, Oas, OpenAPIV3, SchemaObject } from '@kubb/oas'\nimport { isDiscriminator, isNullable, isReference } from '@kubb/oas'\nimport pLimit from 'p-limit'\nimport { isDeepEqual, isNumber, uniqueWith } from 'remeda'\nimport type { Generator } from './generator.tsx'\nimport type { Schema, SchemaKeywordMapper } from './SchemaMapper.ts'\nimport { isKeyword, schemaKeywords } from './SchemaMapper.ts'\nimport type { OperationSchema, Override, Refs } from './types.ts'\nimport { getSchemaFactory } from './utils/getSchemaFactory.ts'\nimport { getSchemas } from './utils/getSchemas.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' | 'void'\n emptySchemaType: 'any' | 'unknown' | 'void'\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 schemaObject?: SchemaObject\n name?: string\n parentName?: string\n}\n\nexport class SchemaGenerator<\n TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions,\n TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions,\n TFileMeta extends FileMetaBase = FileMetaBase,\n> extends BaseGenerator<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): Array<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): Array<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 (isKeyword(schema, schemaKeywords.object)) {\n Object.values(schema.args?.properties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>(entrySchema, keyword))\n })\n\n Object.values(schema.args?.additionalProperties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.array)) {\n schema.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.and)) {\n schema.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.tuple)) {\n schema.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.union)) {\n schema.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\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (isKeyword(schema, schemaKeywords.object)) {\n Object.values(schema.args?.properties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>(entrySchema, keyword)\n }\n })\n\n Object.values(schema.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\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (isKeyword(schema, schemaKeywords.array)) {\n schema.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (isKeyword(schema, schemaKeywords.and)) {\n schema.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (isKeyword(schema, schemaKeywords.tuple)) {\n schema.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (isKeyword(schema, schemaKeywords.union)) {\n schema.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n static combineObjects(tree: Schema[] | undefined): Schema[] {\n if (!tree) {\n return []\n }\n\n return tree.map((schema) => {\n if (!isKeyword(schema, schemaKeywords.and)) {\n return schema\n }\n\n let mergedProperties: Record<string, Schema[]> | null = null\n let mergedAdditionalProps: Schema[] = []\n\n const newArgs: Schema[] = []\n\n for (const subSchema of schema.args) {\n if (isKeyword(subSchema, schemaKeywords.object)) {\n const { properties = {}, additionalProperties = [] } = subSchema.args ?? {}\n\n if (!mergedProperties) {\n mergedProperties = {}\n }\n\n for (const [key, value] of Object.entries(properties)) {\n mergedProperties[key] = value\n }\n\n if (additionalProperties.length > 0) {\n mergedAdditionalProps = additionalProperties\n }\n } else {\n newArgs.push(subSchema)\n }\n }\n\n if (mergedProperties) {\n newArgs.push({\n keyword: schemaKeywords.object,\n args: {\n properties: mergedProperties,\n additionalProperties: mergedAdditionalProps,\n },\n })\n }\n\n return {\n keyword: schemaKeywords.and,\n args: newArgs,\n }\n })\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 #getUnknownType(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n if (options.unknownType === 'any') {\n return schemaKeywords.any\n }\n if (options.unknownType === 'void') {\n return schemaKeywords.void\n }\n\n return schemaKeywords.unknown\n }\n\n #getEmptyType(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n if (options.emptySchemaType === 'any') {\n return schemaKeywords.any\n }\n if (options.emptySchemaType === 'void') {\n return schemaKeywords.void\n }\n\n return schemaKeywords.unknown\n }\n\n /**\n * Recursively creates a type literal with the given props.\n */\n #parseProperties({ schemaObject, name }: SchemaProps): Schema[] {\n const properties = schemaObject?.properties || {}\n const additionalProperties = schemaObject?.additionalProperties\n const required = schemaObject?.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({ schemaObject: 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 || !Object.keys(additionalProperties).length\n ? [{ keyword: this.#getUnknownType({ schemaObject, name }) }]\n : this.parse({ schemaObject: 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(schemaObject: OpenAPIV3.ReferenceObject, name: string | undefined): Schema[] {\n const { $ref } = schemaObject\n const ref = this.refs[$ref]\n\n if (ref) {\n const dereferencedSchema = this.context.oas.dereferenceWithRef(schemaObject)\n // pass name to getRefAlias and use that to find in discriminator.mapping value\n\n if (dereferencedSchema && isDiscriminator(dereferencedSchema)) {\n const [key] = Object.entries(dereferencedSchema.discriminator.mapping || {}).find(([_key, value]) => value.replace(/.+\\//, '') === name) || []\n\n if (key) {\n return [\n {\n keyword: schemaKeywords.and,\n args: [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, $ref, path: ref.path, isImportable: !!this.context.oas.get($ref) },\n },\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n [dereferencedSchema.discriminator.propertyName]: [\n {\n keyword: schemaKeywords.const,\n args: {\n name: key,\n format: 'string',\n value: key,\n },\n },\n ],\n },\n },\n },\n ],\n },\n ] as Schema[]\n }\n }\n\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, $ref, path: ref.path, isImportable: !!this.context.oas.get($ref) },\n },\n ]\n }\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 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 this.refs[$ref] = {\n propertyName,\n originalName,\n path: file.path,\n }\n\n return this.#getRefAlias(schemaObject, name)\n }\n\n #getParsedSchemaObject(schema?: SchemaObject) {\n return getSchemaFactory(this.context.oas)(schema)\n }\n\n #addDiscriminatorToSchema<TSchema extends Schema>({\n schema,\n schemaObject,\n discriminator,\n }: {\n schemaObject: SchemaObject\n schema: TSchema\n discriminator: OpenAPIV3.DiscriminatorObject\n }): TSchema {\n if (!isKeyword(schema, schemaKeywords.union)) {\n return schema\n }\n\n const objectPropertySchema = SchemaGenerator.find(this.parse({ schemaObject: schemaObject }), schemaKeywords.object)\n\n return {\n ...schema,\n args: Object.entries(discriminator.mapping || {}).map(([key, value]) => {\n const arg = schema.args.find((item) => isKeyword(item, schemaKeywords.ref) && item.args.$ref === value)\n return {\n keyword: schemaKeywords.and,\n args: [\n arg,\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n ...(objectPropertySchema?.args?.properties || {}),\n [discriminator.propertyName]: [\n {\n keyword: schemaKeywords.const,\n args: {\n name: key,\n format: 'string',\n value: key,\n },\n },\n //enum and literal will conflict\n ...(objectPropertySchema?.args?.properties[discriminator.propertyName] || []),\n ].filter((item) => !isKeyword(item, schemaKeywords.enum)),\n },\n },\n },\n ],\n }\n }),\n }\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({ schemaObject: _schemaObject, name, parentName }: SchemaProps): Schema[] {\n const { schemaObject, version } = this.#getParsedSchemaObject(_schemaObject)\n\n const options = this.#getOptions({ schemaObject, name })\n const emptyType = this.#getEmptyType({ schemaObject, name })\n\n if (!schemaObject) {\n return [{ keyword: emptyType }]\n }\n\n const baseItems: Schema[] = [\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schemaObject.type as any,\n format: schemaObject.format,\n },\n },\n ]\n const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined\n const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.maxItems ?? undefined\n const nullable = isNullable(schemaObject)\n const defaultNullAndNullable = schemaObject.default === null && nullable\n\n if (schemaObject.default !== undefined && !defaultNullAndNullable && !Array.isArray(schemaObject.default)) {\n if (typeof schemaObject.default === 'string') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: transformers.stringify(schemaObject.default),\n })\n } else if (typeof schemaObject.default === 'boolean') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schemaObject.default ?? false,\n })\n } else {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schemaObject.default,\n })\n }\n }\n\n if (schemaObject.deprecated) {\n baseItems.push({\n keyword: schemaKeywords.deprecated,\n })\n }\n\n if (schemaObject.description) {\n baseItems.push({\n keyword: schemaKeywords.describe,\n args: schemaObject.description,\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 (schemaObject.type && Array.isArray(schemaObject.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 items = schemaObject.type.filter((value) => value !== 'null') as Array<OpenAPIV3.NonArraySchemaObjectType>\n const hasNull = (schemaObject.type as string[]).includes('null')\n\n if (hasNull && !nullable) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n\n if (items.length > 1) {\n const parsedItems = [\n {\n keyword: schemaKeywords.union,\n args: items\n .map(\n (item) =>\n this.parse({\n schemaObject: { ...schemaObject, type: item },\n name,\n parentName,\n })[0],\n )\n .filter(Boolean)\n .filter((item) => !isKeyword(item, schemaKeywords.unknown))\n .map((item) => (isKeyword(item, schemaKeywords.object) ? { ...item, args: { ...item.args, strict: true } } : item)),\n },\n ]\n\n return [...parsedItems, ...baseItems].filter(Boolean)\n }\n }\n\n if (schemaObject.readOnly) {\n baseItems.push({ keyword: schemaKeywords.readOnly })\n }\n\n if (schemaObject.writeOnly) {\n baseItems.push({ keyword: schemaKeywords.writeOnly })\n }\n\n if (isReference(schemaObject)) {\n return [\n ...this.#getRefAlias(schemaObject, name),\n schemaObject.description && {\n keyword: schemaKeywords.describe,\n args: schemaObject.description,\n },\n schemaObject.pattern &&\n schemaObject.type === 'string' && {\n keyword: schemaKeywords.matches,\n args: schemaObject.pattern,\n },\n nullable && { keyword: schemaKeywords.nullable },\n schemaObject.readOnly && { keyword: schemaKeywords.readOnly },\n schemaObject.writeOnly && { keyword: schemaKeywords.writeOnly },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schemaObject.type as any,\n format: schemaObject.format,\n },\n },\n ].filter(Boolean)\n }\n\n if (schemaObject.oneOf || schemaObject.anyOf) {\n // union\n const schemaWithoutOneOf = { ...schemaObject, oneOf: undefined, anyOf: undefined }\n const discriminator = this.context.oas.getDiscriminator(schemaObject)\n\n const union: SchemaKeywordMapper['union'] = {\n keyword: schemaKeywords.union,\n args: (schemaObject.oneOf || schemaObject.anyOf)!\n .map((item) => {\n // first item, this will be ref\n return item && this.parse({ schemaObject: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => !isKeyword(item, schemaKeywords.unknown)),\n }\n\n if (discriminator) {\n if (this.context) return [this.#addDiscriminatorToSchema({ schemaObject: schemaWithoutOneOf, schema: union, discriminator }), ...baseItems]\n }\n\n if (schemaWithoutOneOf.properties) {\n const propertySchemas = this.parse({ schemaObject: schemaWithoutOneOf, name, parentName })\n\n union.args = [\n ...union.args.map((arg) => {\n return {\n keyword: schemaKeywords.and,\n args: [arg, ...propertySchemas],\n }\n }),\n ]\n\n return [union, ...baseItems]\n }\n\n return [union, ...baseItems]\n }\n\n if (schemaObject.allOf) {\n // intersection/add\n const schemaWithoutAllOf = { ...schemaObject, allOf: undefined }\n\n const and: Schema = {\n keyword: schemaKeywords.and,\n args: schemaObject.allOf\n .map((item) => {\n return item && this.parse({ schemaObject: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => !isKeyword(item, schemaKeywords.unknown)),\n }\n\n if (schemaWithoutAllOf.required?.length) {\n const allOfItems = schemaObject.allOf\n const resolvedSchemas: SchemaObject[] = []\n\n for (const item of allOfItems) {\n const resolved = isReference(item) ? (this.context.oas.get(item.$ref) as SchemaObject) : item\n\n if (resolved) {\n resolvedSchemas.push(resolved)\n }\n }\n\n const existingKeys = schemaWithoutAllOf.properties ? new Set(Object.keys(schemaWithoutAllOf.properties)) : null\n\n const parsedItems: SchemaObject[] = []\n\n for (const key of schemaWithoutAllOf.required) {\n if (existingKeys?.has(key)) {\n continue\n }\n\n for (const schema of resolvedSchemas) {\n if (schema.properties?.[key]) {\n parsedItems.push({\n properties: {\n [key]: schema.properties[key],\n },\n required: [key],\n } as SchemaObject)\n break\n }\n }\n }\n\n for (const item of parsedItems) {\n const parsed = this.parse({ schemaObject: item, name, parentName })\n\n if (Array.isArray(parsed)) {\n and.args = and.args ? and.args.concat(parsed) : parsed\n }\n }\n }\n\n if (schemaWithoutAllOf.properties) {\n and.args = [...(and.args || []), ...this.parse({ schemaObject: schemaWithoutAllOf, name, parentName })]\n }\n\n return SchemaGenerator.combineObjects([and, ...baseItems])\n }\n\n if (schemaObject.enum) {\n if (options.enumSuffix === '') {\n this.context.pluginManager.logger.emit('info', 'EnumSuffix set to an empty string does not work')\n }\n\n const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(' ')), this.#getUsedEnumNames({ schemaObject, 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 = schemaObject.enum.includes(null)\n if (nullableEnum) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n const filteredValues = schemaObject.enum.filter((value) => value !== null)\n\n // x-enumNames has priority\n const extensionEnums = ['x-enumNames', 'x-enum-varnames']\n .filter((extensionKey) => extensionKey in schemaObject)\n .map((extensionKey) => {\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name,\n typeName,\n asConst: false,\n items: [...new Set(schemaObject[extensionKey as keyof typeof schemaObject] as string[])].map((name: string | number, index) => ({\n name: transformers.stringify(name),\n value: schemaObject.enum?.[index] as string | number,\n format: isNumber(schemaObject.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 (schemaObject.type === 'number' || schemaObject.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 (schemaObject.type === 'boolean') {\n // we cannot use z.enum when enum type is boolean\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: 'boolean',\n }))\n : [...new Set(filteredValues)].map((value: string) => {\n return {\n name: value,\n value,\n format: 'boolean',\n }\n }),\n },\n },\n ...baseItems.filter((item) => 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 schemaObject) {\n const prefixItems = schemaObject.prefixItems as SchemaObject[]\n const items = 'items' in schemaObject ? (schemaObject.items as SchemaObject[]) : []\n const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined\n const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.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({ schemaObject: item, name, parentName })[0]\n })\n .filter(Boolean),\n rest: this.parse({\n schemaObject: items,\n name,\n parentName,\n })[0],\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (version === '3.1' && 'const' in schemaObject) {\n // const keyword takes precendence over the actual type.\n\n if (schemaObject['const'] === null) {\n return [{ keyword: schemaKeywords.null }]\n }\n if (schemaObject['const'] === undefined) {\n return [{ keyword: schemaKeywords.undefined }]\n }\n\n let format = typeof schemaObject['const']\n if (format !== 'number' && format !== 'boolean') {\n format = 'string'\n }\n\n return [\n {\n keyword: schemaKeywords.const,\n args: {\n name: schemaObject['const'],\n format,\n value: schemaObject['const'],\n },\n },\n ...baseItems,\n ]\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 (schemaObject.format) {\n if (schemaObject.type === 'integer' && (schemaObject.format === 'int32' || schemaObject.format === 'int64')) {\n baseItems.unshift({ keyword: schemaKeywords.integer })\n return baseItems\n }\n\n if (schemaObject.type === 'number' && (schemaObject.format === 'float' || schemaObject.format === 'double')) {\n baseItems.unshift({ keyword: schemaKeywords.number })\n return baseItems\n }\n\n switch (schemaObject.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 return baseItems\n case 'email':\n case 'idn-email':\n baseItems.unshift({ keyword: schemaKeywords.email })\n return baseItems\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 return baseItems\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 if (schemaObject.pattern && schemaObject.type === 'string') {\n baseItems.unshift({\n keyword: schemaKeywords.matches,\n args: schemaObject.pattern,\n })\n\n return baseItems\n }\n\n // type based logic\n if ('items' in schemaObject || schemaObject.type === ('array' as 'string')) {\n const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined\n const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.maxItems ?? undefined\n const items = this.parse({ schemaObject: 'items' in schemaObject ? (schemaObject.items as SchemaObject) : [], name, parentName })\n const unique = !!schemaObject.uniqueItems\n\n return [\n {\n keyword: schemaKeywords.array,\n args: {\n items,\n min,\n max,\n unique,\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (schemaObject.properties || schemaObject.additionalProperties) {\n if (isDiscriminator(schemaObject)) {\n // override schema to set type to be based on discriminator mapping, use of enum to convert type string to type 'mapping1' | 'mapping2'\n const schemaObjectOverriden = Object.keys(schemaObject.properties || {}).reduce((acc, propertyName) => {\n if (acc.properties?.[propertyName] && propertyName === schemaObject.discriminator.propertyName) {\n return {\n ...acc,\n properties: {\n ...acc.properties,\n [propertyName]: {\n ...((acc.properties[propertyName] as any) || {}),\n enum: schemaObject.discriminator.mapping ? Object.keys(schemaObject.discriminator.mapping) : undefined,\n },\n },\n }\n }\n\n return acc\n }, schemaObject || {}) as SchemaObject\n\n return [\n ...this.#parseProperties({\n schemaObject: schemaObjectOverriden,\n name,\n }),\n ...baseItems,\n ]\n }\n\n return [...this.#parseProperties({ schemaObject, name }), ...baseItems]\n }\n\n if (schemaObject.type) {\n const type = (\n Array.isArray(schemaObject.type) ? schemaObject.type.filter((item) => item !== 'null')[0] : schemaObject.type\n ) as OpenAPIV3.NonArraySchemaObjectType\n\n if (!['boolean', 'object', 'number', 'string', 'integer', 'null'].includes(type)) {\n this.context.pluginManager.logger.emit('warning', `Schema type '${schemaObject.type}' is not valid for schema ${parentName}.${name}`)\n }\n\n // 'string' | 'number' | 'integer' | 'boolean'\n return [{ keyword: type }, ...baseItems]\n }\n\n return [{ keyword: emptyType }]\n }\n\n async build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>> {\n const { oas, contentType, include } = this.context\n const schemas = getSchemas({ oas, contentType, includes: include })\n const schemaEntries = Object.entries(schemas)\n\n const generatorLimit = pLimit(1)\n const schemaLimit = pLimit(10)\n\n const writeTasks = generators.map((generator) =>\n generatorLimit(async () => {\n const schemaTasks = schemaEntries.map(([name, schemaObject]) =>\n schemaLimit(async () => {\n const options = this.#getOptions({ name })\n const tree = this.parse({ name, schemaObject })\n\n const result = await generator.schema?.({\n instance: this,\n schema: {\n name,\n value: schemaObject,\n tree,\n },\n options: {\n ...this.options,\n ...options,\n },\n })\n\n return result ?? []\n }),\n )\n\n const schemaResults = await Promise.all(schemaTasks)\n return schemaResults.flat() as unknown as KubbFile.File<TFileMeta>\n }),\n )\n\n const nestedResults = await Promise.all(writeTasks)\n\n return nestedResults.flat()\n }\n}\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;AAKA,IAAM,OAAN,MAAW;CACV;CACA;CAEA,YAAY,OAAO;AAClB,OAAK,QAAQ;;;AAIf,IAAqB,QAArB,MAA2B;CAC1B;CACA;CACA;CAEA,cAAc;AACb,OAAK;;CAGN,QAAQ,OAAO;EACd,MAAM,OAAO,IAAI,KAAK;AAEtB,MAAI,MAAKA,MAAO;AACf,SAAKC,KAAM,OAAO;AAClB,SAAKA,OAAQ;SACP;AACN,SAAKD,OAAQ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