@kubb/plugin-oas 2.26.8 → 2.27.1

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.
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  SchemaGenerator,
3
3
  schemaKeywords
4
- } from "./chunk-ORUZ7QDT.js";
4
+ } from "./chunk-IWUQTVK4.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM,
8
8
  init_esm_shims
9
- } from "./chunk-LZNNIZXR.js";
9
+ } from "./chunk-DW4XVEE4.js";
10
10
 
11
11
  // ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
12
12
  var require_react_production_min = __commonJS({
@@ -3262,4 +3262,4 @@ react/cjs/react-jsx-runtime.development.js:
3262
3262
  * LICENSE file in the root directory of this source tree.
3263
3263
  *)
3264
3264
  */
3265
- //# sourceMappingURL=chunk-YVC7FUTG.js.map
3265
+ //# sourceMappingURL=chunk-P7OMLU5B.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-LZNNIZXR.js";
3
+ } from "./chunk-DW4XVEE4.js";
4
4
 
5
5
  // src/utils/parseFromConfig.ts
6
6
  init_esm_shims();
@@ -32,4 +32,4 @@ function parseFromConfig(config, oasClass = Oas) {
32
32
  export {
33
33
  parseFromConfig
34
34
  };
35
- //# sourceMappingURL=chunk-ZEDQKDE3.js.map
35
+ //# sourceMappingURL=chunk-RFA6KMXR.js.map
@@ -5,10 +5,10 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
8
+ var _chunkH4D7FGDYcjs = require('./chunk-H4D7FGDY.cjs');
9
9
 
10
10
  // src/SchemaMapper.ts
11
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
11
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
12
12
  var schemaKeywords = {
13
13
  any: "any",
14
14
  strict: "strict",
@@ -61,7 +61,7 @@ function isKeyword(meta, keyword) {
61
61
  }
62
62
 
63
63
  // src/SchemaGenerator.ts
64
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
64
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
65
65
  var _core = require('@kubb/core');
66
66
  var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
67
67
  var _utils = require('@kubb/core/utils');
@@ -71,11 +71,11 @@ var _usedAliasNames, _SchemaGenerator_instances, getUsedEnumNames_fn, getOptions
71
71
  var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
72
72
  constructor() {
73
73
  super(...arguments);
74
- _chunkNYLS3UNEcjs.__privateAdd.call(void 0, this, _SchemaGenerator_instances);
74
+ _chunkH4D7FGDYcjs.__privateAdd.call(void 0, this, _SchemaGenerator_instances);
75
75
  // Collect the types of all referenced schemas, so we can export them later
76
76
  this.refs = {};
77
77
  // Keep track of already used type aliases
78
- _chunkNYLS3UNEcjs.__privateAdd.call(void 0, this, _usedAliasNames, {});
78
+ _chunkH4D7FGDYcjs.__privateAdd.call(void 0, this, _usedAliasNames, {});
79
79
  }
80
80
  /**
81
81
  * Creates a type node from a given schema.
@@ -83,8 +83,8 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
83
83
  * optionally adds a union with null.
84
84
  */
85
85
  parse(props) {
86
- const options = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, props);
87
- const defaultSchemas = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, parseSchemaObject_fn).call(this, props);
86
+ const options = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, props);
87
+ const defaultSchemas = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, parseSchemaObject_fn).call(this, props);
88
88
  const schemas = _optionalChain([options, 'access', _ => _.transformers, 'optionalAccess', _2 => _2.schema, 'optionalCall', _3 => _3(props, defaultSchemas)]) || defaultSchemas || [];
89
89
  return _remeda.uniqueWith.call(void 0, schemas, _remeda.isDeepEqual);
90
90
  }
@@ -201,9 +201,10 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
201
201
  }
202
202
  async build() {
203
203
  const { oas, contentType, include } = this.context;
204
- const schemas = _chunkNYLS3UNEcjs.getSchemas.call(void 0, { oas, contentType, includes: include });
204
+ oas.resolveDiscriminators();
205
+ const schemas = _chunkH4D7FGDYcjs.getSchemas.call(void 0, { oas, contentType, includes: include });
205
206
  const promises = Object.entries(schemas).reduce((acc, [name, schema]) => {
206
- const options = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, { name });
207
+ const options = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, { name });
207
208
  const promiseOperation = this.schema.call(this, name, schema, {
208
209
  ...this.options,
209
210
  ...options
@@ -220,7 +221,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
220
221
  _usedAliasNames = new WeakMap();
221
222
  _SchemaGenerator_instances = new WeakSet();
222
223
  getUsedEnumNames_fn = function(props) {
223
- const options = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, props);
224
+ const options = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, props);
224
225
  return options.usedEnumNames || {};
225
226
  };
226
227
  getOptions_fn = function({ name }) {
@@ -236,7 +237,7 @@ getOptions_fn = function({ name }) {
236
237
  };
237
238
  };
238
239
  getUnknownReturn_fn = function(props) {
239
- const options = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, props);
240
+ const options = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, props);
240
241
  if (options.unknownType === "any") {
241
242
  return schemaKeywords.any;
242
243
  }
@@ -270,7 +271,7 @@ parseProperties_fn = function({ schema, name }) {
270
271
  }).reduce((acc, curr) => ({ ...acc, ...curr }), {});
271
272
  let additionalPropertiesSchemas = [];
272
273
  if (additionalProperties) {
273
- additionalPropertiesSchemas = additionalProperties === true || !Object.keys(additionalProperties).length ? [{ keyword: _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getUnknownReturn_fn).call(this, { schema, name }) }] : this.parse({ schema: additionalProperties, parentName: name });
274
+ additionalPropertiesSchemas = additionalProperties === true || !Object.keys(additionalProperties).length ? [{ keyword: _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getUnknownReturn_fn).call(this, { schema, name }) }] : this.parse({ schema: additionalProperties, parentName: name });
274
275
  }
275
276
  return [
276
277
  {
@@ -288,7 +289,7 @@ parseProperties_fn = function({ schema, name }) {
288
289
  getRefAlias_fn = function(obj) {
289
290
  const { $ref } = obj;
290
291
  let ref = this.refs[$ref];
291
- const originalName = _utils.getUniqueName.call(void 0, $ref.replace(/.+\//, ""), _chunkNYLS3UNEcjs.__privateGet.call(void 0, this, _usedAliasNames));
292
+ const originalName = _utils.getUniqueName.call(void 0, $ref.replace(/.+\//, ""), _chunkH4D7FGDYcjs.__privateGet.call(void 0, this, _usedAliasNames));
292
293
  const propertyName = this.context.pluginManager.resolveName({
293
294
  name: originalName,
294
295
  pluginKey: this.context.plugin.key,
@@ -325,7 +326,7 @@ getRefAlias_fn = function(obj) {
325
326
  ];
326
327
  };
327
328
  getParsedSchemaObject_fn = function(schema) {
328
- const parsedSchema = _chunkNYLS3UNEcjs.getSchemaFactory.call(void 0, this.context.oas)(schema);
329
+ const parsedSchema = _chunkH4D7FGDYcjs.getSchemaFactory.call(void 0, this.context.oas)(schema);
329
330
  return parsedSchema;
330
331
  };
331
332
  /**
@@ -333,9 +334,9 @@ getParsedSchemaObject_fn = function(schema) {
333
334
  * schema and returns the appropriate type.
334
335
  */
335
336
  parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
336
- const options = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, { schema: _schema, name });
337
- const unknownReturn = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getUnknownReturn_fn).call(this, { schema: _schema, name });
338
- const { schema, version } = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getParsedSchemaObject_fn).call(this, _schema);
337
+ const options = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getOptions_fn).call(this, { schema: _schema, name });
338
+ const unknownReturn = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getUnknownReturn_fn).call(this, { schema: _schema, name });
339
+ const { schema, version } = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getParsedSchemaObject_fn).call(this, _schema);
339
340
  if (!schema) {
340
341
  return [{ keyword: unknownReturn }];
341
342
  }
@@ -404,7 +405,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
404
405
  }
405
406
  if (_oas.isReference.call(void 0, schema)) {
406
407
  return [
407
- ..._chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getRefAlias_fn).call(this, schema),
408
+ ..._chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getRefAlias_fn).call(this, schema),
408
409
  nullable && { keyword: schemaKeywords.nullable },
409
410
  schema.readOnly && { keyword: schemaKeywords.readOnly },
410
411
  schema.writeOnly && { keyword: schemaKeywords.writeOnly },
@@ -428,7 +429,19 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
428
429
  })
429
430
  };
430
431
  if (schemaWithoutOneOf.properties) {
431
- return [...this.parse({ schema: schemaWithoutOneOf, name, parentName }), union, ...baseItems];
432
+ const propertySchemas = this.parse({ schema: schemaWithoutOneOf, name, parentName });
433
+ return [
434
+ {
435
+ ...union,
436
+ args: union.args.map((arg) => {
437
+ return {
438
+ keyword: schemaKeywords.and,
439
+ args: [arg, ...propertySchemas]
440
+ };
441
+ })
442
+ },
443
+ ...baseItems
444
+ ];
432
445
  }
433
446
  return [union, ...baseItems];
434
447
  }
@@ -480,7 +493,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
480
493
  return [and, ...baseItems];
481
494
  }
482
495
  if (schema.enum) {
483
- const enumName = _utils.getUniqueName.call(void 0, _transformers.pascalCase.call(void 0, [parentName, name, options.enumSuffix].join(" ")), _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getUsedEnumNames_fn).call(this, { schema, name }));
496
+ const enumName = _utils.getUniqueName.call(void 0, _transformers.pascalCase.call(void 0, [parentName, name, options.enumSuffix].join(" ")), _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, getUsedEnumNames_fn).call(this, { schema, name }));
484
497
  const typeName = this.context.pluginManager.resolveName({
485
498
  name: enumName,
486
499
  pluginKey: this.context.plugin.key,
@@ -697,7 +710,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
697
710
  ];
698
711
  }
699
712
  if (schema.properties || schema.additionalProperties) {
700
- return [..._chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, parseProperties_fn).call(this, { schema, name }), ...baseItems];
713
+ return [..._chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _SchemaGenerator_instances, parseProperties_fn).call(this, { schema, name }), ...baseItems];
701
714
  }
702
715
  if (schema.type) {
703
716
  if (Array.isArray(schema.type)) {
@@ -728,4 +741,4 @@ var SchemaGenerator = _SchemaGenerator;
728
741
 
729
742
 
730
743
  exports.schemaKeywords = schemaKeywords; exports.isKeyword = isKeyword; exports.SchemaGenerator = SchemaGenerator;
731
- //# sourceMappingURL=chunk-LM4GEHMH.cjs.map
744
+ //# sourceMappingURL=chunk-VSCBUJRS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-VSCBUJRS.cjs","../src/SchemaMapper.ts","../src/SchemaGenerator.ts"],"names":["_schema","nullable","name","min","max"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACTA,8CAAA,CAAA;AAgFO,IAAM,eAAA,EAAiB;AAAA,EAC5B,GAAA,EAAK,KAAA;AAAA,EACL,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,SAAA;AAAA,EACT,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,SAAA;AAAA,EACT,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,SAAA;AAAA,EACT,SAAA,EAAW,WAAA;AAAA,EACX,QAAA,EAAU,UAAA;AAAA,EACV,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,SAAA;AAAA,EACT,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,QAAA,EAAU,UAAA;AAAA,EACV,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,KAAA;AAAA;AAAA,EAEL,OAAA,EAAS,SAAA;AAAA,EACT,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAU,UAAA;AAAA,EACV,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAU,UAAA;AAAA,EACV,QAAA,EAAU,UAAA;AAAA,EACV,SAAA,EAAW,WAAA;AAAA;AAAA,EAGX,MAAA,EAAQ,QAAA;AAAA,EACR,GAAA,EAAK,KAAA;A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AAI,CAAA,0BAAA,EAA6B,UAAU,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAC9H,IAAA;AAG8C,IAAA;AAChD,EAAA;AAEkC,EAAA;AACpC;AAjyBK;AFgqB4H;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-VSCBUJRS.cjs","sourcesContent":[null,"import type * as KubbFile from '@kubb/fs/types'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n strict?: boolean\n }\n }\n strict: { keyword: 'strict' }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: { name: string; path: KubbFile.OptionalPath }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n strict: 'strict',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n","import { type FileMetaBase, Generator } from '@kubb/core'\nimport transformers, { pascalCase } from '@kubb/core/transformers'\nimport { getUniqueName } from '@kubb/core/utils'\n\nimport { isReference } from '@kubb/oas'\nimport { isDeepEqual, isNumber, uniqueWith } from 'remeda'\nimport { isKeyword, schemaKeywords } from './SchemaMapper.ts'\nimport { getSchemaFactory } from './utils/getSchemaFactory.ts'\nimport { getSchemas } from './utils/getSchemas.ts'\n\nimport type { Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from '@kubb/core'\nimport type * as KubbFile from '@kubb/fs/types'\n\nimport type { Oas, OpenAPIV3, SchemaObject, contentType } from '@kubb/oas'\nimport type { Schema, SchemaKeywordMapper } from './SchemaMapper.ts'\nimport type { OperationSchema, Override, Refs } from './types.ts'\n\nexport type GetSchemaGeneratorOptions<T extends SchemaGenerator<any, any, any>> = T extends SchemaGenerator<infer Options, any, any> ? Options : never\n\nexport type SchemaMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>\n\ntype Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {\n oas: Oas\n pluginManager: PluginManager\n /**\n * Current plugin\n */\n plugin: Plugin<TPluginOptions>\n mode: KubbFile.Mode\n include?: Array<'schemas' | 'responses' | 'requestBodies'>\n override: Array<Override<TOptions>> | undefined\n contentType?: contentType\n output?: string\n}\n\nexport type SchemaGeneratorOptions = {\n dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date'\n unknownType: 'any' | 'unknown'\n enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n enumSuffix?: string\n usedEnumNames?: Record<string, number>\n mapper?: Record<string, string>\n typed?: boolean\n transformers: {\n /**\n * Customize the names based on the type that is provided by the plugin.\n */\n name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string\n /**\n * Receive schema and name(propertName) and return FakerMeta array\n * TODO TODO add docs\n * @beta\n */\n schema?: (schemaProps: SchemaProps, defaultSchemas: Schema[]) => Schema[] | undefined\n }\n}\n\nexport type SchemaGeneratorBuildOptions = Omit<OperationSchema, 'name' | 'schema'>\n\ntype SchemaProps = {\n schema?: SchemaObject\n name?: string\n parentName?: string\n}\n\nexport abstract class SchemaGenerator<\n TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions,\n TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions,\n TFileMeta extends FileMetaBase = FileMetaBase,\n> extends Generator<TOptions, Context<TOptions, TPluginOptions>> {\n // Collect the types of all referenced schemas, so we can export them later\n refs: Refs = {}\n\n // Keep track of already used type aliases\n #usedAliasNames: Record<string, number> = {}\n\n /**\n * Creates a type node from a given schema.\n * Delegates to getBaseTypeFromSchema internally and\n * optionally adds a union with null.\n */\n parse(props: SchemaProps): Schema[] {\n const options = this.#getOptions(props)\n\n const defaultSchemas = this.#parseSchemaObject(props)\n const schemas = options.transformers?.schema?.(props, defaultSchemas) || defaultSchemas || []\n\n return uniqueWith(schemas, isDeepEqual)\n }\n\n deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][] {\n return SchemaGenerator.deepSearch<T>(tree, keyword)\n }\n\n find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n return SchemaGenerator.find<T>(tree, keyword)\n }\n\n static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][] {\n const foundItems: SchemaKeywordMapper[T][] = []\n\n tree?.forEach((schema) => {\n if (schema.keyword === keyword) {\n foundItems.push(schema as SchemaKeywordMapper[T])\n }\n\n if (schema.keyword === schemaKeywords.object) {\n const subItem = schema as SchemaKeywordMapper['object']\n\n Object.values(subItem.args?.properties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>(entrySchema, keyword))\n })\n\n Object.values(subItem.args?.additionalProperties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.array) {\n const subItem = schema as SchemaKeywordMapper['array']\n\n subItem.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.and) {\n const subItem = schema as SchemaKeywordMapper['and']\n\n subItem.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.tuple) {\n const subItem = schema as SchemaKeywordMapper['tuple']\n\n subItem.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.union) {\n const subItem = schema as SchemaKeywordMapper['union']\n\n subItem.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n })\n\n return foundItems\n }\n\n static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined = undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (schema.keyword === schemaKeywords.object) {\n const subItem = schema as SchemaKeywordMapper['object']\n\n Object.values(subItem.args?.properties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>(entrySchema, keyword)\n }\n })\n\n Object.values(subItem.args?.additionalProperties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined = undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (schema.keyword === schemaKeywords.array) {\n const subItem = schema as SchemaKeywordMapper['array']\n\n subItem.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.and) {\n const subItem = schema as SchemaKeywordMapper['and']\n\n subItem.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.tuple) {\n const subItem = schema as SchemaKeywordMapper['tuple']\n\n subItem.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.union) {\n const subItem = schema as SchemaKeywordMapper['union']\n\n subItem.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n #getUsedEnumNames(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n return options.usedEnumNames || {}\n }\n\n #getOptions({ name }: SchemaProps): Partial<TOptions> {\n const { override = [] } = this.context\n\n return {\n ...this.options,\n ...(override.find(({ pattern, type }) => {\n if (name && type === 'schemaName') {\n return !!name.match(pattern)\n }\n\n return false\n })?.options || {}),\n }\n }\n\n #getUnknownReturn(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n if (options.unknownType === 'any') {\n return schemaKeywords.any\n }\n\n return schemaKeywords.unknown\n }\n\n /**\n * Recursively creates a type literal with the given props.\n */\n #parseProperties({ schema, name }: SchemaProps): Schema[] {\n const properties = schema?.properties || {}\n const additionalProperties = schema?.additionalProperties\n const required = schema?.required\n\n const propertiesSchemas = Object.keys(properties)\n .map((propertyName) => {\n const validationFunctions: Schema[] = []\n const propertySchema = properties[propertyName] as SchemaObject\n\n const isRequired = Array.isArray(required) ? required?.includes(propertyName) : !!required\n const nullable = propertySchema.nullable ?? propertySchema['x-nullable'] ?? false\n\n validationFunctions.push(...this.parse({ schema: propertySchema, name: propertyName, parentName: name }))\n\n validationFunctions.push({\n keyword: schemaKeywords.name,\n args: propertyName,\n })\n\n if (!isRequired && nullable) {\n validationFunctions.push({ keyword: schemaKeywords.nullish })\n } else if (!isRequired) {\n validationFunctions.push({ keyword: schemaKeywords.optional })\n }\n\n return {\n [propertyName]: validationFunctions,\n }\n })\n .reduce((acc, curr) => ({ ...acc, ...curr }), {})\n let additionalPropertiesSchemas: Schema[] = []\n\n if (additionalProperties) {\n additionalPropertiesSchemas =\n additionalProperties === true || !Object.keys(additionalProperties).length\n ? [{ keyword: this.#getUnknownReturn({ schema, name }) }]\n : this.parse({ schema: additionalProperties as SchemaObject, parentName: name })\n }\n\n return [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: propertiesSchemas,\n additionalProperties: additionalPropertiesSchemas,\n },\n },\n ]\n }\n\n /**\n * Create a type alias for the schema referenced by the given ReferenceObject\n */\n #getRefAlias(obj: OpenAPIV3.ReferenceObject): Schema[] {\n const { $ref } = obj\n let ref = this.refs[$ref]\n\n const originalName = getUniqueName($ref.replace(/.+\\//, ''), this.#usedAliasNames)\n const propertyName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'function',\n })\n\n if (ref) {\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, path: ref.path },\n },\n ]\n }\n\n const fileName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'file',\n })\n const file = this.context.pluginManager.getFile({\n name: fileName,\n pluginKey: this.context.plugin.key,\n extName: '.ts',\n })\n\n ref = this.refs[$ref] = {\n propertyName,\n originalName,\n path: file.path,\n }\n\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, path: ref?.path },\n },\n ]\n }\n\n #getParsedSchemaObject(schema?: SchemaObject) {\n const parsedSchema = getSchemaFactory(this.context.oas)(schema)\n return parsedSchema\n }\n\n /**\n * This is the very core of the OpenAPI to TS conversion - it takes a\n * schema and returns the appropriate type.\n */\n #parseSchemaObject({ schema: _schema, name, parentName }: SchemaProps): Schema[] {\n const options = this.#getOptions({ schema: _schema, name })\n const unknownReturn = this.#getUnknownReturn({ schema: _schema, name })\n const { schema, version } = this.#getParsedSchemaObject(_schema)\n if (!schema) {\n return [{ keyword: unknownReturn }]\n }\n\n const baseItems: Schema[] = [\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schema.type as any,\n format: schema.format,\n },\n },\n ]\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n const nullable = schema.nullable ?? schema['x-nullable'] ?? false\n\n if (schema.default !== undefined && !Array.isArray(schema.default)) {\n if (typeof schema.default === 'string') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: transformers.stringify(schema.default),\n })\n } else if (typeof schema.default === 'boolean') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schema.default ?? false,\n })\n } else {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schema.default,\n })\n }\n }\n\n if (schema.description) {\n baseItems.push({\n keyword: schemaKeywords.describe,\n args: schema.description,\n })\n }\n\n if (schema.pattern) {\n baseItems.unshift({\n keyword: schemaKeywords.matches,\n args: schema.pattern,\n })\n }\n\n if (max !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.max, args: max })\n }\n\n if (min !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.min, args: min })\n }\n\n if (nullable) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n\n if (schema.type && Array.isArray(schema.type)) {\n const [_schema, nullable] = schema.type\n\n if (nullable === 'null') {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n }\n\n if (schema.readOnly) {\n baseItems.push({ keyword: schemaKeywords.readOnly })\n }\n\n if (schema.writeOnly) {\n baseItems.push({ keyword: schemaKeywords.writeOnly })\n }\n\n if (isReference(schema)) {\n return [\n ...this.#getRefAlias(schema),\n nullable && { keyword: schemaKeywords.nullable },\n schema.readOnly && { keyword: schemaKeywords.readOnly },\n schema.writeOnly && { keyword: schemaKeywords.writeOnly },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schema.type as any,\n format: schema.format,\n },\n },\n ].filter(Boolean)\n }\n\n if (schema.oneOf) {\n // union\n const schemaWithoutOneOf = { ...schema, oneOf: undefined }\n\n const union: Schema = {\n keyword: schemaKeywords.union,\n args: schema.oneOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n }),\n }\n if (schemaWithoutOneOf.properties) {\n const propertySchemas = this.parse({ schema: schemaWithoutOneOf, name, parentName })\n\n return [\n {\n ...union,\n args: union.args.map((arg) => {\n return {\n keyword: schemaKeywords.and,\n args: [arg, ...propertySchemas],\n }\n }),\n },\n ...baseItems,\n ]\n }\n\n return [union, ...baseItems]\n }\n\n if (schema.anyOf) {\n // union\n const schemaWithoutAnyOf = { ...schema, anyOf: undefined }\n\n const union: Schema = {\n keyword: schemaKeywords.union,\n args: schema.anyOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n })\n .map((item) => {\n if (isKeyword(item, schemaKeywords.object)) {\n return {\n ...item,\n args: {\n ...item.args,\n strict: true,\n },\n }\n }\n return item\n }),\n }\n if (schemaWithoutAnyOf.properties) {\n return [...this.parse({ schema: schemaWithoutAnyOf, name, parentName }), union, ...baseItems]\n }\n\n return [union, ...baseItems]\n }\n if (schema.allOf) {\n // intersection/add\n const schemaWithoutAllOf = { ...schema, allOf: undefined }\n\n const and: Schema = {\n keyword: schemaKeywords.and,\n args: schema.allOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n }),\n }\n\n if (schemaWithoutAllOf.properties) {\n return [\n {\n ...and,\n args: [...(and.args || []), ...this.parse({ schema: schemaWithoutAllOf, name, parentName })],\n },\n ...baseItems,\n ]\n }\n\n return [and, ...baseItems]\n }\n\n if (schema.enum) {\n const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(' ')), this.#getUsedEnumNames({ schema, name }))\n const typeName = this.context.pluginManager.resolveName({\n name: enumName,\n pluginKey: this.context.plugin.key,\n type: 'type',\n })\n\n const nullableEnum = schema.enum.includes(null)\n if (nullableEnum) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n const filteredValues = schema.enum.filter((value) => value !== null)\n\n // x-enumNames has priority\n const extensionEnums = ['x-enumNames', 'x-enum-varnames']\n .filter((extensionKey) => extensionKey in schema)\n .map((extensionKey) => {\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name,\n typeName,\n asConst: false,\n items: [...new Set(schema[extensionKey as keyof typeof schema] as string[])].map((name: string | number, index) => ({\n name: transformers.stringify(name),\n value: schema.enum?.[index] as string | number,\n format: isNumber(schema.enum?.[index]) ? 'number' : 'string',\n })),\n },\n },\n ...baseItems.filter(\n (item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches,\n ),\n ]\n })\n\n if (schema.type === 'number' || schema.type === 'integer') {\n // we cannot use z.enum when enum type is number/integer\n const enumNames = extensionEnums[0]?.find((item) => isKeyword(item, schemaKeywords.enum)) as unknown as SchemaKeywordMapper['enum']\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: true,\n items: enumNames?.args?.items\n ? [...new Set(enumNames.args.items)].map(({ name, value }) => ({\n name,\n value,\n format: 'number',\n }))\n : [...new Set(filteredValues)].map((value: string) => {\n return {\n name: value,\n value,\n format: 'number',\n }\n }),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if (schema.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 schema) {\n const prefixItems = schema.prefixItems as SchemaObject[]\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n\n return [\n {\n keyword: schemaKeywords.tuple,\n args: {\n min,\n max,\n items: prefixItems\n .map((item) => {\n return this.parse({ schema: item, name, parentName })[0]\n })\n .filter(Boolean),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (version === '3.1' && 'const' in schema) {\n // const keyword takes precendence over the actual type.\n if (schema['const']) {\n return [\n {\n keyword: schemaKeywords.const,\n args: {\n name: schema['const'],\n format: typeof schema['const'] === 'number' ? 'number' : 'string',\n value: schema['const'],\n },\n },\n ...baseItems,\n ]\n }\n return [{ keyword: schemaKeywords.null }]\n }\n\n /**\n * > Structural validation alone may be insufficient to allow an application to correctly utilize certain values. The \"format\"\n * > annotation keyword is defined to allow schema authors to convey semantic information for a fixed subset of values which are\n * > accurately described by authoritative resources, be they RFCs or other external specifications.\n *\n * In other words: format is more specific than type alone, hence it should override the type value, if possible.\n *\n * see also https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.7\n */\n if (schema.format) {\n switch (schema.format) {\n case 'binary':\n baseItems.push({ keyword: schemaKeywords.blob })\n return baseItems\n case 'date-time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n if (options.dateType === 'stringOffset') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: true } })\n return baseItems\n }\n\n if (options.dateType === 'stringLocal') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { local: true } })\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: false } })\n\n return baseItems\n }\n break\n case 'date':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'uuid':\n baseItems.unshift({ keyword: schemaKeywords.uuid })\n break\n case 'email':\n case 'idn-email':\n baseItems.unshift({ keyword: schemaKeywords.email })\n break\n case 'uri':\n case 'ipv4':\n case 'ipv6':\n case 'uri-reference':\n case 'hostname':\n case 'idn-hostname':\n baseItems.unshift({ keyword: schemaKeywords.url })\n break\n // case 'duration':\n // case 'json-pointer':\n // case 'relative-json-pointer':\n default:\n // formats not yet implemented: ignore.\n break\n }\n }\n\n // type based logic\n if ('items' in schema || schema.type === ('array' as 'string')) {\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n const items = this.parse({ schema: 'items' in schema ? (schema.items as SchemaObject) : [], name, parentName })\n\n return [\n {\n keyword: schemaKeywords.array,\n args: {\n items,\n min,\n max,\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (schema.properties || schema.additionalProperties) {\n return [...this.#parseProperties({ schema, name }), ...baseItems]\n }\n\n if (schema.type) {\n if (Array.isArray(schema.type)) {\n // OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0\n const [type] = schema.type as Array<OpenAPIV3.NonArraySchemaObjectType>\n\n return [\n ...this.parse({\n schema: {\n ...schema,\n type,\n },\n name,\n parentName,\n }),\n ...baseItems,\n ].filter(Boolean)\n }\n\n if (!['boolean', 'object', 'number', 'string', 'integer', 'null'].includes(schema.type)) {\n this.context.pluginManager.logger.emit('warning', `Schema type '${schema.type}' is not valid for schema ${parentName}.${name}`)\n }\n\n // 'string' | 'number' | 'integer' | 'boolean'\n return [{ keyword: schema.type }, ...baseItems]\n }\n\n return [{ keyword: unknownReturn }]\n }\n\n async build(): Promise<Array<KubbFile.File<TFileMeta>>> {\n const { oas, contentType, include } = this.context\n\n oas.resolveDiscriminators()\n\n const schemas = getSchemas({ oas, contentType, includes: include })\n\n const promises = Object.entries(schemas).reduce((acc, [name, schema]) => {\n const options = this.#getOptions({ name })\n const promiseOperation = this.schema.call(this, name, schema, {\n ...this.options,\n ...options,\n })\n\n if (promiseOperation) {\n acc.push(promiseOperation)\n }\n\n return acc\n }, [] as SchemaMethodResult<TFileMeta>[])\n\n const files = await Promise.all(promises)\n\n // using .flat because schemaGenerator[method] can return a array of files or just one file\n return files.flat().filter(Boolean)\n }\n\n /**\n * Schema\n */\n abstract schema(name: string, object: SchemaObject, options: TOptions): SchemaMethodResult<TFileMeta>\n}\n"]}
@@ -2,17 +2,17 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkTBLKBM2Ccjs = require('./chunk-TBLKBM2C.cjs');
6
- require('./chunk-LM4GEHMH.cjs');
5
+ var _chunkKMF5VE6Jcjs = require('./chunk-KMF5VE6J.cjs');
6
+ require('./chunk-VSCBUJRS.cjs');
7
7
 
8
8
 
9
- var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
9
+ var _chunkH4D7FGDYcjs = require('./chunk-H4D7FGDY.cjs');
10
10
 
11
11
  // src/components/index.ts
12
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
12
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.Oas = _chunkTBLKBM2Ccjs.Oas; exports.Operation = _chunkTBLKBM2Ccjs.Operation; exports.Schema = _chunkTBLKBM2Ccjs.Schema;
17
+ exports.Oas = _chunkKMF5VE6Jcjs.Oas; exports.Operation = _chunkKMF5VE6Jcjs.Operation; exports.Schema = _chunkKMF5VE6Jcjs.Schema;
18
18
  //# sourceMappingURL=components.cjs.map
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  Schema
5
- } from "./chunk-YVC7FUTG.js";
6
- import "./chunk-ORUZ7QDT.js";
5
+ } from "./chunk-P7OMLU5B.js";
6
+ import "./chunk-IWUQTVK4.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-LZNNIZXR.js";
9
+ } from "./chunk-DW4XVEE4.js";
10
10
 
11
11
  // src/components/index.ts
12
12
  init_esm_shims();
package/dist/hooks.cjs CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkTBLKBM2Ccjs = require('./chunk-TBLKBM2C.cjs');
6
- require('./chunk-LM4GEHMH.cjs');
5
+ var _chunkKMF5VE6Jcjs = require('./chunk-KMF5VE6J.cjs');
6
+ require('./chunk-VSCBUJRS.cjs');
7
7
 
8
8
 
9
- var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
9
+ var _chunkH4D7FGDYcjs = require('./chunk-H4D7FGDY.cjs');
10
10
 
11
11
  // src/hooks/index.ts
12
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
12
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
  // src/hooks/useOas.ts
15
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
15
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
16
16
  var _react = require('@kubb/react');
17
17
  function useOas() {
18
- const { oas } = _react.useContext.call(void 0, _chunkTBLKBM2Ccjs.Oas.Context);
18
+ const { oas } = _react.useContext.call(void 0, _chunkKMF5VE6Jcjs.Oas.Context);
19
19
  if (!oas) {
20
20
  throw new Error("Oas is not defined");
21
21
  }
@@ -23,10 +23,10 @@ function useOas() {
23
23
  }
24
24
 
25
25
  // src/hooks/useOperation.ts
26
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
26
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
27
27
 
28
28
  function useOperation() {
29
- const { operation } = _react.useContext.call(void 0, _chunkTBLKBM2Ccjs.Operation.Context);
29
+ const { operation } = _react.useContext.call(void 0, _chunkKMF5VE6Jcjs.Operation.Context);
30
30
  if (!operation) {
31
31
  throw new Error("Operation is not defined");
32
32
  }
@@ -34,11 +34,11 @@ function useOperation() {
34
34
  }
35
35
 
36
36
  // src/hooks/useOperationManager.ts
37
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
37
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
38
38
 
39
39
  function useOperationManager() {
40
40
  const { plugin, pluginManager } = _react.useApp.call(void 0, );
41
- const { generator } = _react.useContext.call(void 0, _chunkTBLKBM2Ccjs.Oas.Context);
41
+ const { generator } = _react.useContext.call(void 0, _chunkKMF5VE6Jcjs.Oas.Context);
42
42
  if (!generator) {
43
43
  throw new Error(`'generator' is not defined`);
44
44
  }
@@ -139,10 +139,10 @@ function useOperationManager() {
139
139
  }
140
140
 
141
141
  // src/hooks/useOperations.ts
142
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
142
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
143
143
 
144
144
  function useOperations({ method, path } = {}) {
145
- const { operations } = _react.useContext.call(void 0, _chunkTBLKBM2Ccjs.Oas.Context);
145
+ const { operations } = _react.useContext.call(void 0, _chunkKMF5VE6Jcjs.Oas.Context);
146
146
  if (!operations) {
147
147
  throw new Error("Operations is not defined");
148
148
  }
@@ -161,5 +161,5 @@ function useOperations({ method, path } = {}) {
161
161
 
162
162
 
163
163
 
164
- exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkTBLKBM2Ccjs.useSchema;
164
+ exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkKMF5VE6Jcjs.useSchema;
165
165
  //# sourceMappingURL=hooks.cjs.map
package/dist/hooks.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  useSchema
5
- } from "./chunk-YVC7FUTG.js";
6
- import "./chunk-ORUZ7QDT.js";
5
+ } from "./chunk-P7OMLU5B.js";
6
+ import "./chunk-IWUQTVK4.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-LZNNIZXR.js";
9
+ } from "./chunk-DW4XVEE4.js";
10
10
 
11
11
  // src/hooks/index.ts
12
12
  init_esm_shims();
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkHJ3WPZICcjs = require('./chunk-HJ3WPZIC.cjs');
3
+ var _chunk6I26SJV6cjs = require('./chunk-6I26SJV6.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkLM4GEHMHcjs = require('./chunk-LM4GEHMH.cjs');
8
+ var _chunkVSCBUJRScjs = require('./chunk-VSCBUJRS.cjs');
9
9
 
10
10
 
11
11
 
@@ -13,13 +13,13 @@ var _chunkLM4GEHMHcjs = require('./chunk-LM4GEHMH.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
16
+ var _chunkH4D7FGDYcjs = require('./chunk-H4D7FGDY.cjs');
17
17
 
18
18
  // src/index.ts
19
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
19
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
20
20
 
21
21
  // src/plugin.ts
22
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
22
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
23
23
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
24
24
  var _core = require('@kubb/core');
25
25
  var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
@@ -28,7 +28,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
28
28
  const { output = { path: "schemas", export: false }, validate = true, serverIndex = 0, contentType, oasClass } = options;
29
29
  const getOas = async ({ config, logger }) => {
30
30
  try {
31
- const oas = await _chunkHJ3WPZICcjs.parseFromConfig.call(void 0, config, oasClass);
31
+ const oas = await _chunk6I26SJV6cjs.parseFromConfig.call(void 0, config, oasClass);
32
32
  if (validate) {
33
33
  await oas.valdiate();
34
34
  }
@@ -36,7 +36,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
36
36
  } catch (e) {
37
37
  const error = e;
38
38
  logger.emit("warning", _optionalChain([error, 'optionalAccess', _ => _.message]));
39
- return _chunkHJ3WPZICcjs.parseFromConfig.call(void 0, config, oasClass);
39
+ return _chunk6I26SJV6cjs.parseFromConfig.call(void 0, config, oasClass);
40
40
  }
41
41
  };
42
42
  return {
@@ -50,7 +50,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
50
50
  },
51
51
  async getSchemas({ includes } = {}) {
52
52
  const oas = await this.getOas();
53
- return _chunkNYLS3UNEcjs.getSchemas.call(void 0, { oas, contentType, includes });
53
+ return _chunkH4D7FGDYcjs.getSchemas.call(void 0, { oas, contentType, includes });
54
54
  },
55
55
  async getBaseURL() {
56
56
  const oasInstance = await this.getOas();
@@ -85,7 +85,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
85
85
  logger: this.logger
86
86
  });
87
87
  await oas.dereference();
88
- const schemas = _chunkNYLS3UNEcjs.getSchemas.call(void 0, { oas, contentType });
88
+ const schemas = _chunkH4D7FGDYcjs.getSchemas.call(void 0, { oas, contentType });
89
89
  const mapSchema = async ([name, schema]) => {
90
90
  const resolvedPath = this.resolvePath({
91
91
  baseName: `${name}.json`,
@@ -115,21 +115,21 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
115
115
  });
116
116
 
117
117
  // src/OperationGenerator.ts
118
- _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
118
+ _chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
119
119
 
120
120
 
121
121
  var _operationsByMethod, _OperationGenerator_instances, getOptions_fn, isExcluded_fn, isIncluded_fn, methods_get;
122
122
  var OperationGenerator = class extends _core.Generator {
123
123
  constructor() {
124
124
  super(...arguments);
125
- _chunkNYLS3UNEcjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
126
- _chunkNYLS3UNEcjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
125
+ _chunkH4D7FGDYcjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
126
+ _chunkH4D7FGDYcjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
127
127
  }
128
128
  get operationsByMethod() {
129
- return _chunkNYLS3UNEcjs.__privateGet.call(void 0, this, _operationsByMethod);
129
+ return _chunkH4D7FGDYcjs.__privateGet.call(void 0, this, _operationsByMethod);
130
130
  }
131
131
  set operationsByMethod(paths) {
132
- _chunkNYLS3UNEcjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
132
+ _chunkH4D7FGDYcjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
133
133
  }
134
134
  getSchemas(operation, { forStatusCode, resolveName = (name) => name } = {}) {
135
135
  const pathParamsSchema = this.context.oas.getParametersSchema(operation, "path");
@@ -212,9 +212,9 @@ var OperationGenerator = class extends _core.Generator {
212
212
  const methods = Object.keys(method);
213
213
  methods.forEach((method2) => {
214
214
  const operation = oas.operation(path2, method2);
215
- if (operation && _chunkNYLS3UNEcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
216
- const isExcluded = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
217
- const isIncluded = this.context.include ? _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
215
+ if (operation && _chunkH4D7FGDYcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
216
+ const isExcluded = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
217
+ const isIncluded = this.context.include ? _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
218
218
  if (isIncluded && !isExcluded) {
219
219
  if (!acc[path2]) {
220
220
  acc[path2] = {};
@@ -235,8 +235,8 @@ var OperationGenerator = class extends _core.Generator {
235
235
  const methods = this.operationsByMethod[path2] ? Object.keys(this.operationsByMethod[path2]) : [];
236
236
  methods.forEach((method) => {
237
237
  const { operation } = _optionalChain([this, 'access', _37 => _37.operationsByMethod, 'access', _38 => _38[path2], 'optionalAccess', _39 => _39[method]]);
238
- const options = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
239
- const promiseMethod = _optionalChain([_chunkNYLS3UNEcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
238
+ const options = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
239
+ const promiseMethod = _optionalChain([_chunkH4D7FGDYcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
240
240
  ...this.options,
241
241
  ...options
242
242
  })]);
@@ -391,5 +391,5 @@ var src_default = definePluginDefault;
391
391
 
392
392
 
393
393
 
394
- exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkLM4GEHMHcjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkLM4GEHMHcjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkLM4GEHMHcjs.schemaKeywords;
394
+ exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkVSCBUJRScjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkVSCBUJRScjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkVSCBUJRScjs.schemaKeywords;
395
395
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  parseFromConfig
3
- } from "./chunk-ZEDQKDE3.js";
3
+ } from "./chunk-RFA6KMXR.js";
4
4
  import {
5
5
  SchemaGenerator,
6
6
  isKeyword,
7
7
  schemaKeywords
8
- } from "./chunk-ORUZ7QDT.js";
8
+ } from "./chunk-IWUQTVK4.js";
9
9
  import {
10
10
  __privateAdd,
11
11
  __privateGet,
@@ -13,7 +13,7 @@ import {
13
13
  __privateSet,
14
14
  getSchemas,
15
15
  init_esm_shims
16
- } from "./chunk-LZNNIZXR.js";
16
+ } from "./chunk-DW4XVEE4.js";
17
17
 
18
18
  // src/index.ts
19
19
  init_esm_shims();