@kubb/plugin-oas 3.5.13 → 3.6.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.
- package/dist/{OperationGenerator-C_n_FNWe.d.cts → OperationGenerator-D6qT-x7V.d.cts} +2 -2
- package/dist/{OperationGenerator-C_n_FNWe.d.ts → OperationGenerator-D6qT-x7V.d.ts} +2 -2
- package/dist/{Schema-CisxeooY.d.ts → Schema-DGs068EF.d.ts} +1 -1
- package/dist/{Schema-0TEphQBX.d.cts → Schema-Dy3_sEjT.d.cts} +1 -1
- package/dist/chunk-3DX5ALTN.js +4 -4
- package/dist/chunk-3DX5ALTN.js.map +1 -1
- package/dist/chunk-EMSV6TX2.js +1 -1
- package/dist/{chunk-M7Q45QED.js → chunk-RLUM7GVZ.js} +19 -16
- package/dist/chunk-RLUM7GVZ.js.map +1 -0
- package/dist/chunk-TKFFW62C.cjs +3 -3
- package/dist/chunk-TKFFW62C.cjs.map +1 -1
- package/dist/{chunk-I2J55EM2.cjs → chunk-WZRTTAGB.cjs} +19 -16
- package/dist/chunk-WZRTTAGB.cjs.map +1 -0
- package/dist/components.d.cts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/hooks.cjs +7 -7
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +6 -6
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +9 -9
- package/src/SchemaGenerator.ts +4 -0
- package/dist/chunk-I2J55EM2.cjs.map +0 -1
- package/dist/chunk-M7Q45QED.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Plugin,
|
|
1
|
+
import { Plugin, Output, Group, PluginFactoryOptions, ResolveNameParams, FileMetaBase, BaseGenerator, PluginManager } from '@kubb/core';
|
|
2
2
|
import * as KubbFile from '@kubb/fs/types';
|
|
3
|
-
import {
|
|
3
|
+
import { HttpMethod, Operation, SchemaObject, Oas, contentType } from '@kubb/oas';
|
|
4
4
|
import { KubbNode } from '@kubb/react/types';
|
|
5
5
|
|
|
6
6
|
type SchemaKeywordMapper = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Plugin,
|
|
1
|
+
import { Plugin, Output, Group, PluginFactoryOptions, ResolveNameParams, FileMetaBase, BaseGenerator, PluginManager } from '@kubb/core';
|
|
2
2
|
import * as KubbFile from '@kubb/fs/types';
|
|
3
|
-
import {
|
|
3
|
+
import { HttpMethod, Operation, SchemaObject, Oas, contentType } from '@kubb/oas';
|
|
4
4
|
import { KubbNode } from '@kubb/react/types';
|
|
5
5
|
|
|
6
6
|
type SchemaKeywordMapper = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { SchemaObject } from '@kubb/oas';
|
|
3
3
|
import { Key, KubbNode } from '@kubb/react/types';
|
|
4
|
-
import { f as Schema$1 } from './OperationGenerator-
|
|
4
|
+
import { f as Schema$1 } from './OperationGenerator-D6qT-x7V.js';
|
|
5
5
|
|
|
6
6
|
type SchemaContextProps = {
|
|
7
7
|
name: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { SchemaObject } from '@kubb/oas';
|
|
3
3
|
import { Key, KubbNode } from '@kubb/react/types';
|
|
4
|
-
import { f as Schema$1 } from './OperationGenerator-
|
|
4
|
+
import { f as Schema$1 } from './OperationGenerator-D6qT-x7V.cjs';
|
|
5
5
|
|
|
6
6
|
type SchemaContextProps = {
|
|
7
7
|
name: string;
|
package/dist/chunk-3DX5ALTN.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import transformers, { isValidVarName, camelCase } from '@kubb/core/transformers';
|
|
2
2
|
import { URLPath } from '@kubb/core/utils';
|
|
3
|
-
import { isParameterObject, parse
|
|
3
|
+
import { Oas, isParameterObject, parse } from '@kubb/oas';
|
|
4
4
|
export { isOptional } from '@kubb/oas';
|
|
5
5
|
import { resolve } from 'node:path';
|
|
6
6
|
import yaml from '@stoplight/yaml';
|
|
@@ -28,7 +28,7 @@ function getASTParams(operationSchema, {
|
|
|
28
28
|
name,
|
|
29
29
|
enabled: !!name,
|
|
30
30
|
required: isParam ? schema.required : true,
|
|
31
|
-
type: typed ? `${operationSchema.name}["${name}"]` :
|
|
31
|
+
type: typed ? `${operationSchema.name}["${name}"]` : void 0
|
|
32
32
|
};
|
|
33
33
|
return override ? override(data) : data;
|
|
34
34
|
});
|
|
@@ -70,7 +70,7 @@ function parseFromConfig(config, oasClass = Oas) {
|
|
|
70
70
|
}
|
|
71
71
|
function getBanner({ output, oas }) {
|
|
72
72
|
if (!output.banner) {
|
|
73
|
-
return
|
|
73
|
+
return void 0;
|
|
74
74
|
}
|
|
75
75
|
if (isFunction(output.banner)) {
|
|
76
76
|
return output.banner(oas);
|
|
@@ -79,7 +79,7 @@ function getBanner({ output, oas }) {
|
|
|
79
79
|
}
|
|
80
80
|
function getFooter({ output, oas }) {
|
|
81
81
|
if (!output.footer) {
|
|
82
|
-
return
|
|
82
|
+
return void 0;
|
|
83
83
|
}
|
|
84
84
|
if (isFunction(output.footer)) {
|
|
85
85
|
return output.footer(oas);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts","../src/utils/parseFromConfig.ts","../src/utils/getBanner.ts","../src/utils/getFooter.ts"],"names":["api","URLPath","isFunction"],"mappings":";;;;;;;;;AAKO,SAAS,YAAY,SAAgC,EAAA;AAC1D,EAAO,OAAA;AAAA,IACL,UAAU,cAAe,EAAA,IAAK,CAAgB,aAAA,EAA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,CAAM,IAAI,CAAC,CAAA;AAE9E,IAAO,OAAA,KAAA,CAAM,KAAK,QAAQ,CAAA;AAAA;AAG5B,EAAA,IAAI,IAAIC,OAAQ,CAAA,MAAA,CAAO,KAAM,CAAA,IAAI,EAAE,KAAO,EAAA;AACxC,IAAA,OAAO,KAAM,CAAA,MAAA,CAAO,KAAM,CAAA,IAAA,EAAM,QAAQ,CAAA;AAAA;AAG1C,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAO,CAAA,IAAA,EAAM,OAAO,KAAM,CAAA,IAAI,GAAG,QAAQ,CAAA;AAChE;AC1BO,SAAS,SAAU,CAAA,EAAE,MAAQ,EAAA,GAAA,EAAc,EAAA;AAChD,EAAI,IAAA,CAAC,OAAO,MAAQ,EAAA;AAClB,IAAO,OAAA,
|
|
1
|
+
{"version":3,"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts","../src/utils/parseFromConfig.ts","../src/utils/getBanner.ts","../src/utils/getFooter.ts"],"names":["api","URLPath","isFunction"],"mappings":";;;;;;;;;AAKO,SAAS,YAAY,SAAgC,EAAA;AAC1D,EAAO,OAAA;AAAA,IACL,UAAU,cAAe,EAAA,IAAK,CAAgB,aAAA,EAAA,SAAA,CAAU,gBAAgB,CAAA,CAAA;AAAA,IACxE,UAAU,UAAW,EAAA,IAAK,CAAY,SAAA,EAAA,SAAA,CAAU,YAAY,CAAA,CAAA;AAAA,IAC5D,SAAA,CAAU,QAAQ,CAAU,OAAA,EAAA,IAAI,QAAQ,SAAU,CAAA,IAAI,EAAE,GAAG,CAAA,CAAA,CAAA;AAAA,IAC3D,SAAA,CAAU,cAAkB,IAAA;AAAA,GAC9B,CACG,MAAO,CAAA,OAAO,CACd,CAAA,GAAA,CAAI,CAAC,IAAS,KAAA,YAAA,CAAa,IAAK,CAAA,IAAI,CAAC,CAAA;AAC1C;ACFO,SAAS,aACd,eACA,EAAA;AAAA,EACE,KAAQ,GAAA,KAAA;AAAA,EACR;AACF,CAAA,GAGI,EACiB,E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A,MAAA;AAAA;AAGT,EAAI,IAAA,UAAA,CAAW,MAAO,CAAA,MAAM,CAAG,EAAA;AAC7B,IAAO,OAAA,MAAA,CAAO,OAAO,GAAG,CAAA;AAAA;AAG1B,EAAA,OAAO,MAAO,CAAA,MAAA;AAChB;ACVO,SAAS,SAAU,CAAA,EAAE,MAAQ,EAAA,GAAA,EAAc,EAAA;AAChD,EAAI,IAAA,CAAC,OAAO,MAAQ,EAAA;AAClB,IAAO,OAAA,MAAA;AAAA;AAGT,EAAIC,IAAAA,UAAAA,CAAW,MAAO,CAAA,MAAM,CAAG,EAAA;AAC7B,IAAO,OAAA,MAAA,CAAO,OAAO,GAAG,CAAA;AAAA;AAG1B,EAAA,OAAO,MAAO,CAAA,MAAA;AAChB","file":"chunk-3DX5ALTN.js","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","import { resolve } from 'node:path'\n\nimport { URLPath } from '@kubb/core/utils'\n\nimport { 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 (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","import type { Output } from '@kubb/core'\nimport type { Oas } from '@kubb/oas'\nimport { isFunction } from 'remeda'\n\ntype Props = {\n oas: Oas\n output: Output<Oas>\n}\n\nexport function getBanner({ output, oas }: Props) {\n if (!output.banner) {\n return undefined\n }\n\n if (isFunction(output.banner)) {\n return output.banner(oas)\n }\n\n return output.banner\n}\n","import type { Output } from '@kubb/core'\nimport type { Oas } from '@kubb/oas'\nimport { isFunction } from 'remeda'\n\ntype Props = {\n oas: Oas\n output: Output<Oas>\n}\n\nexport function getFooter({ output, oas }: Props) {\n if (!output.footer) {\n return undefined\n }\n\n if (isFunction(output.footer)) {\n return output.footer(oas)\n }\n\n return output.footer\n}\n"]}
|
package/dist/chunk-EMSV6TX2.js
CHANGED
|
@@ -121,7 +121,7 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
121
121
|
return foundItems;
|
|
122
122
|
}
|
|
123
123
|
static findInObject(tree, keyword) {
|
|
124
|
-
let foundItem =
|
|
124
|
+
let foundItem = void 0;
|
|
125
125
|
tree?.forEach((schema) => {
|
|
126
126
|
if (!foundItem && schema.keyword === keyword) {
|
|
127
127
|
foundItem = schema;
|
|
@@ -143,7 +143,7 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
143
143
|
return foundItem;
|
|
144
144
|
}
|
|
145
145
|
static find(tree, keyword) {
|
|
146
|
-
let foundItem =
|
|
146
|
+
let foundItem = void 0;
|
|
147
147
|
tree?.forEach((schema) => {
|
|
148
148
|
if (!foundItem && schema.keyword === keyword) {
|
|
149
149
|
foundItem = schema;
|
|
@@ -312,11 +312,11 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
];
|
|
315
|
-
const min = schema.minimum ?? schema.minLength ?? schema.minItems ??
|
|
316
|
-
const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ??
|
|
315
|
+
const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? void 0;
|
|
316
|
+
const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? void 0;
|
|
317
317
|
const nullable = schema.nullable ?? schema["x-nullable"] ?? false;
|
|
318
318
|
const defaultNullAndNullable = schema.default === null && nullable;
|
|
319
|
-
if (schema.default !==
|
|
319
|
+
if (schema.default !== void 0 && !defaultNullAndNullable && !Array.isArray(schema.default)) {
|
|
320
320
|
if (typeof schema.default === "string") {
|
|
321
321
|
baseItems.push({
|
|
322
322
|
keyword: schemaKeywords.default,
|
|
@@ -345,10 +345,10 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
345
345
|
args: schema.description
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
if (max !==
|
|
348
|
+
if (max !== void 0) {
|
|
349
349
|
baseItems.unshift({ keyword: schemaKeywords.max, args: max });
|
|
350
350
|
}
|
|
351
|
-
if (min !==
|
|
351
|
+
if (min !== void 0) {
|
|
352
352
|
baseItems.unshift({ keyword: schemaKeywords.min, args: min });
|
|
353
353
|
}
|
|
354
354
|
if (nullable) {
|
|
@@ -382,7 +382,7 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
382
382
|
].filter(Boolean);
|
|
383
383
|
}
|
|
384
384
|
if (schema.oneOf) {
|
|
385
|
-
const schemaWithoutOneOf = { ...schema, oneOf:
|
|
385
|
+
const schemaWithoutOneOf = { ...schema, oneOf: void 0 };
|
|
386
386
|
const union = {
|
|
387
387
|
keyword: schemaKeywords.union,
|
|
388
388
|
args: schema.oneOf.map((item) => {
|
|
@@ -405,7 +405,7 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
405
405
|
return [union, ...baseItems];
|
|
406
406
|
}
|
|
407
407
|
if (schema.anyOf) {
|
|
408
|
-
const schemaWithoutAnyOf = { ...schema, anyOf:
|
|
408
|
+
const schemaWithoutAnyOf = { ...schema, anyOf: void 0 };
|
|
409
409
|
const union = {
|
|
410
410
|
keyword: schemaKeywords.union,
|
|
411
411
|
args: schema.anyOf.map((item) => {
|
|
@@ -431,7 +431,7 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
431
431
|
return [union, ...baseItems];
|
|
432
432
|
}
|
|
433
433
|
if (schema.allOf) {
|
|
434
|
-
const schemaWithoutAllOf = { ...schema, allOf:
|
|
434
|
+
const schemaWithoutAllOf = { ...schema, allOf: void 0 };
|
|
435
435
|
const and = {
|
|
436
436
|
keyword: schemaKeywords.and,
|
|
437
437
|
args: schema.allOf.map((item) => {
|
|
@@ -471,6 +471,9 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
471
471
|
return [and, ...baseItems];
|
|
472
472
|
}
|
|
473
473
|
if (schema.enum) {
|
|
474
|
+
if (options.enumSuffix === "") {
|
|
475
|
+
throw new Error("EnumSuffix set to an empty string does not work");
|
|
476
|
+
}
|
|
474
477
|
const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(" ")), this.#getUsedEnumNames({ schema, name }));
|
|
475
478
|
const typeName = this.context.pluginManager.resolveName({
|
|
476
479
|
name: enumName,
|
|
@@ -574,8 +577,8 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
574
577
|
}
|
|
575
578
|
if ("prefixItems" in schema) {
|
|
576
579
|
const prefixItems = schema.prefixItems;
|
|
577
|
-
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ??
|
|
578
|
-
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ??
|
|
580
|
+
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ?? void 0;
|
|
581
|
+
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? void 0;
|
|
579
582
|
return [
|
|
580
583
|
{
|
|
581
584
|
keyword: schemaKeywords.tuple,
|
|
@@ -674,8 +677,8 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
674
677
|
return baseItems;
|
|
675
678
|
}
|
|
676
679
|
if ("items" in schema || schema.type === "array") {
|
|
677
|
-
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ??
|
|
678
|
-
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ??
|
|
680
|
+
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ?? void 0;
|
|
681
|
+
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? void 0;
|
|
679
682
|
const items = this.parse({ schema: "items" in schema ? schema.items : [], name, parentName });
|
|
680
683
|
const unique = !!schema.uniqueItems;
|
|
681
684
|
return [
|
|
@@ -764,5 +767,5 @@ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
|
764
767
|
};
|
|
765
768
|
|
|
766
769
|
export { SchemaGenerator, isKeyword, schemaKeywords };
|
|
767
|
-
//# sourceMappingURL=chunk-
|
|
768
|
-
//# sourceMappingURL=chunk-
|
|
770
|
+
//# sourceMappingURL=chunk-RLUM7GVZ.js.map
|
|
771
|
+
//# sourceMappingURL=chunk-RLUM7GVZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SchemaMapper.ts","../src/SchemaGenerator.ts"],"names":["_schema","nullable","schema","name","min","max"],"mappings":";;;;;;;;AA2FO,IAAM,cAAiB,GAAA;AAAA,EAC5B,GAAK,EAAA,KAAA;AAAA,EACL,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,SAAW,EAAA,WAAA;AAAA,EACX,QAAU,EAAA,UAAA;AAAA,EACV,IAAM,EAAA,MAAA;AAAA,EACN,OAAS,EAAA,SAAA;AAAA,EACT,KAAO,EAAA,OAAA;AAAA,EACP,KAAO,EAAA,OAAA;AAAA,EACP,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,OAAA;AAAA,EACP,QAAU,EAAA,UAAA;AAAA,EACV,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,OAAA;AAAA,EACP,IAAM,EAAA,MAAA;AAAA,EACN,GAAK,EAAA,KAAA;AAAA;AAAA,EAEL,OAAS,EAAA,SAAA;AAAA,EACT,KAAO,EAAA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,CAAA;AAED,MAAA,IAAI,gBAAkB,EAAA;AACpB,QAAA,GAAA,CAAI,KAAK,gBAAgB,CAAA;AAAA;AAG3B,MAAY,UAAA,EAAA,OAAA,CAAQ,CAAC,SAAc,KAAA;AACjC,QAAA,MAAM,OAAO,IAAK,CAAA,KAAA,CAAM,EAAE,MAAQ,EAAA,KAAA,EAAO,MAAY,CAAA;AAErD,QAAM,MAAA,OAAA,GAAU,UAAU,MAAS,GAAA;AAAA,UACjC,QAAU,EAAA,IAAA;AAAA,UACV,MAAQ,EAAA;AAAA,YACN,IAAA;AAAA,YACA,KAAA;AAAA,YACA;AAAA,WACF;AAAA,UACA,OAAS,EAAA;AAAA,YACP,GAAG,IAAK,CAAA,OAAA;AAAA,YACR,GAAG;AAAA;AACL,SACM,CAAA;AAER,QAAA,IAAI,OAAS,EAAA;AACX,UAAA,GAAA,CAAI,KAAK,OAAO,CAAA;AAAA;AAClB,OACD,CAAA;AAED,MAAO,OAAA,GAAA;AAAA,KACT,EAAG,EAAqC,CAAA;AAExC,IAAA,MAAM,KAAQ,GAAA,MAAM,OAAQ,CAAA,GAAA,CAAI,QAAQ,CAAA;AAGxC,IAAA,OAAO,KAAM,CAAA,IAAA,EAAO,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA;AACpC;AAAA;AAAA;AAAA,EAKA,MAAM,MAAA,CAAO,KAAe,EAAA,OAAA,EAAuB,QAAmD,EAAA;AACpG,IAAA,OAAO,EAAC;AAAA;AAEZ","file":"chunk-RLUM7GVZ.js","sourcesContent":["import type * as KubbFile from '@kubb/fs/types'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n strict?: boolean\n }\n }\n strict: { keyword: 'strict' }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n 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; unique?: boolean }\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: {\n name: string\n /**\n * Full qualified path.\n */\n path: KubbFile.OptionalPath\n /**\n * When true `File.Import` will be used.\n * When false a reference will be used inside the current file.\n */\n isImportable: boolean\n }\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 type SchemaTree = {\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n}\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 { BaseGenerator, type FileMetaBase } 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 { Generator } from './generator.tsx'\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 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): 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, isImportable: !!this.context.oas.get($ref) },\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, isImportable: !!this.context.oas.get($ref) },\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 const defaultNullAndNullable = schema.default === null && nullable\n\n if (schema.default !== undefined && !defaultNullAndNullable && !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.deprecated) {\n baseItems.push({\n keyword: schemaKeywords.deprecated,\n })\n }\n\n if (schema.description) {\n baseItems.push({\n keyword: schemaKeywords.describe,\n args: schema.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 (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 union.args = [\n ...union.args.map((arg) => {\n return {\n keyword: schemaKeywords.and,\n args: [arg, ...propertySchemas],\n }\n }),\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.required) {\n // TODO use of Required ts helper instead\n const schemas = schema.allOf\n .map((item) => {\n if (isReference(item)) {\n return this.context.oas.get(item.$ref) as SchemaObject\n }\n })\n .filter(Boolean)\n\n const items = schemaWithoutAllOf.required\n .filter((key) => {\n // filter out keys that are already part of the properties(reduce duplicated keys(https://github.com/kubb-labs/kubb/issues/1492)\n if (schemaWithoutAllOf.properties) {\n return !Object.keys(schemaWithoutAllOf.properties).includes(key)\n }\n\n // schema should include required fields when necessary https://github.com/kubb-labs/kubb/issues/1522\n return true\n })\n .map((key) => {\n const schema = schemas.find((item) => item.properties && Object.keys(item.properties).find((propertyKey) => propertyKey === key))\n\n if (schema?.properties?.[key]) {\n return {\n ...schema,\n properties: {\n [key]: schema.properties[key],\n },\n required: [key],\n }\n }\n })\n .filter(Boolean)\n\n and.args = [...(and.args || []), ...items.flatMap((item) => this.parse({ schema: item as SchemaObject, name, parentName }))]\n }\n\n if (schemaWithoutAllOf.properties) {\n and.args = [...(and.args || []), ...this.parse({ schema: schemaWithoutAllOf, name, parentName })]\n }\n\n return [and, ...baseItems]\n }\n\n if (schema.enum) {\n if (options.enumSuffix === '') {\n throw new Error('EnumSuffix set to an empty string does not work')\n }\n\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 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 (schema.pattern) {\n baseItems.unshift({\n keyword: schemaKeywords.matches,\n args: schema.pattern,\n })\n\n return baseItems\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 const unique = !!schema.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 (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(...generators: Array<Generator<TPluginOptions>>): 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, value]) => {\n if (!value) {\n return acc\n }\n\n const options = this.#getOptions({ name })\n const promiseOperation = this.schema.call(this, name, value, {\n ...this.options,\n ...options,\n })\n\n if (promiseOperation) {\n acc.push(promiseOperation)\n }\n\n generators?.forEach((generator) => {\n const tree = this.parse({ schema: value, name: name })\n\n const promise = generator.schema?.({\n instance: this,\n schema: {\n name,\n value,\n tree,\n },\n options: {\n ...this.options,\n ...options,\n },\n } as any) as Promise<Array<KubbFile.File<TFileMeta>>>\n\n if (promise) {\n acc.push(promise)\n }\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 an array of files or just one file\n return files.flat().filter(Boolean)\n }\n\n /**\n * Schema\n */\n async schema(_name: string, _object: SchemaObject, _options: TOptions): SchemaMethodResult<TFileMeta> {\n return []\n }\n}\n"]}
|
package/dist/chunk-TKFFW62C.cjs
CHANGED
|
@@ -34,7 +34,7 @@ function getASTParams(operationSchema, {
|
|
|
34
34
|
name,
|
|
35
35
|
enabled: !!name,
|
|
36
36
|
required: isParam ? schema.required : true,
|
|
37
|
-
type: typed ? `${operationSchema.name}["${name}"]` :
|
|
37
|
+
type: typed ? `${operationSchema.name}["${name}"]` : void 0
|
|
38
38
|
};
|
|
39
39
|
return override ? override(data) : data;
|
|
40
40
|
});
|
|
@@ -76,7 +76,7 @@ function parseFromConfig(config, oasClass = oas.Oas) {
|
|
|
76
76
|
}
|
|
77
77
|
function getBanner({ output, oas }) {
|
|
78
78
|
if (!output.banner) {
|
|
79
|
-
return
|
|
79
|
+
return void 0;
|
|
80
80
|
}
|
|
81
81
|
if (remeda.isFunction(output.banner)) {
|
|
82
82
|
return output.banner(oas);
|
|
@@ -85,7 +85,7 @@ function getBanner({ output, oas }) {
|
|
|
85
85
|
}
|
|
86
86
|
function getFooter({ output, oas }) {
|
|
87
87
|
if (!output.footer) {
|
|
88
|
-
return
|
|
88
|
+
return void 0;
|
|
89
89
|
}
|
|
90
90
|
if (remeda.isFunction(output.footer)) {
|
|
91
91
|
return output.footer(oas);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts","../src/utils/parseFromConfig.ts","../src/utils/getBanner.ts","../src/utils/getFooter.ts"],"names":["URLPath","transformers","isParameterObject","isValidVarName","camelCase","Oas","api","parse","yaml","resolve","isFunction"],"mappings":";;;;;;;;;;;;;;;AAKO,SAAS,YAAY,SAAgC,EAAA;AAC1D,EAAO,OAAA;AAAA,IACL,UAAU,cAAe,EAAA,IAAK,CAAgB,aAAA,EAAA,SAAA,CAAU,gBAAgB,CAAA,CAAA;AAAA,IACxE,UAAU,UAAW,EAAA,IAAK,CAAY,SAAA,EAAA,SAAA,CAAU,YAAY,CAAA,CAAA;AAAA,IAC5D,SAAA,CAAU,QAAQ,CAAU,OAAA,EAAA,IAAIA,cAAQ,SAAU,CAAA,IAAI,EAAE,GAAG,CAAA,CAAA,CAAA;AAAA,IAC3D,SAAA,CAAU,cAAkB,IAAA;AAAA,GAC9B,CACG,MAAO,CAAA,OAAO,CACd,CAAA,GAAA,CAAI,CAAC,IAAS,KAAAC,6BAAA,CAAa,IAAK,CAAA,IAAI,CAAC,CAAA;AAC1C;ACFO,SAAS,aACd,eACA,EAAA;AAAA,EACE,KAAQ,GAAA,K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AChD,EAAI,IAAA,CAAC,OAAO,MAAQ,EAAA;AAClB,IAAO,OAAA,
|
|
1
|
+
{"version":3,"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts","../src/utils/parseFromConfig.ts","../src/utils/getBanner.ts","../src/utils/getFooter.ts"],"names":["URLPath","transformers","isParameterObject","isValidVarName","camelCase","Oas","api","parse","yaml","resolve","isFunction"],"mappings":";;;;;;;;;;;;;;;AAKO,SAAS,YAAY,SAAgC,EAAA;AAC1D,EAAO,OAAA;AAAA,IACL,UAAU,cAAe,EAAA,IAAK,CAAgB,aAAA,EAAA,SAAA,CAAU,gBAAgB,CAAA,CAAA;AAAA,IACxE,UAAU,UAAW,EAAA,IAAK,CAAY,SAAA,EAAA,SAAA,CAAU,YAAY,CAAA,CAAA;AAAA,IAC5D,SAAA,CAAU,QAAQ,CAAU,OAAA,EAAA,IAAIA,cAAQ,SAAU,CAAA,IAAI,EAAE,GAAG,CAAA,CAAA,CAAA;AAAA,IAC3D,SAAA,CAAU,cAAkB,IAAA;AAAA,GAC9B,CACG,MAAO,CAAA,OAAO,CACd,CAAA,GAAA,CAAI,CAAC,IAAS,KAAAC,6BAAA,CAAa,IAAK,CAAA,IAAI,CAAC,CAAA;AAC1C;ACFO,SAAS,aACd,eACA,EAAA;AAAA,EACE,KAAQ,GAAA,KAAA;AAAA,EACR;AACF,CAAA,GAGI,EACiB,EAAA;AACrB,EAAI,IAAA,CAAC,mBAAmB,CAAC,eAAA,CAAgB,OAAO,UAAc,IAAA,CAAC,gBAAgB,IAAM,EAAA;AACnF,IAAA,OAAO,EAAC;AAAA;AAGV,EAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,eAAA,CAAgB,MAAO,CAAA,UAAU,CAAE,CAAA,GAAA,CAAI,CAAC,CAAC,IAAM,EAAA,MAAM,CAAuC,KAAA;AAChH,IAAM,MAAA,OAAA,GAAUC,sBAAkB,MAAM,CAAA;AACxC,IAAA,MAAM,IAA0B,GAAA;AAAA,MAC9B,IAAA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,MAAM,CAAG,EAAA;AAC7B,IAAO,OAAA,MAAA,CAAO,OAAO,GAAG,CAAA;AAAA;AAG1B,EAAA,OAAO,MAAO,CAAA,MAAA;AAChB","file":"chunk-TKFFW62C.cjs","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","import { resolve } from 'node:path'\n\nimport { URLPath } from '@kubb/core/utils'\n\nimport { 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 (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","import type { Output } from '@kubb/core'\nimport type { Oas } from '@kubb/oas'\nimport { isFunction } from 'remeda'\n\ntype Props = {\n oas: Oas\n output: Output<Oas>\n}\n\nexport function getBanner({ output, oas }: Props) {\n if (!output.banner) {\n return undefined\n }\n\n if (isFunction(output.banner)) {\n return output.banner(oas)\n }\n\n return output.banner\n}\n","import type { Output } from '@kubb/core'\nimport type { Oas } from '@kubb/oas'\nimport { isFunction } from 'remeda'\n\ntype Props = {\n oas: Oas\n output: Output<Oas>\n}\n\nexport function getFooter({ output, oas }: Props) {\n if (!output.footer) {\n return undefined\n }\n\n if (isFunction(output.footer)) {\n return output.footer(oas)\n }\n\n return output.footer\n}\n"]}
|
|
@@ -127,7 +127,7 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
127
127
|
return foundItems;
|
|
128
128
|
}
|
|
129
129
|
static findInObject(tree, keyword) {
|
|
130
|
-
let foundItem =
|
|
130
|
+
let foundItem = void 0;
|
|
131
131
|
tree?.forEach((schema) => {
|
|
132
132
|
if (!foundItem && schema.keyword === keyword) {
|
|
133
133
|
foundItem = schema;
|
|
@@ -149,7 +149,7 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
149
149
|
return foundItem;
|
|
150
150
|
}
|
|
151
151
|
static find(tree, keyword) {
|
|
152
|
-
let foundItem =
|
|
152
|
+
let foundItem = void 0;
|
|
153
153
|
tree?.forEach((schema) => {
|
|
154
154
|
if (!foundItem && schema.keyword === keyword) {
|
|
155
155
|
foundItem = schema;
|
|
@@ -318,11 +318,11 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
];
|
|
321
|
-
const min = schema.minimum ?? schema.minLength ?? schema.minItems ??
|
|
322
|
-
const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ??
|
|
321
|
+
const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? void 0;
|
|
322
|
+
const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? void 0;
|
|
323
323
|
const nullable = schema.nullable ?? schema["x-nullable"] ?? false;
|
|
324
324
|
const defaultNullAndNullable = schema.default === null && nullable;
|
|
325
|
-
if (schema.default !==
|
|
325
|
+
if (schema.default !== void 0 && !defaultNullAndNullable && !Array.isArray(schema.default)) {
|
|
326
326
|
if (typeof schema.default === "string") {
|
|
327
327
|
baseItems.push({
|
|
328
328
|
keyword: schemaKeywords.default,
|
|
@@ -351,10 +351,10 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
351
351
|
args: schema.description
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
if (max !==
|
|
354
|
+
if (max !== void 0) {
|
|
355
355
|
baseItems.unshift({ keyword: schemaKeywords.max, args: max });
|
|
356
356
|
}
|
|
357
|
-
if (min !==
|
|
357
|
+
if (min !== void 0) {
|
|
358
358
|
baseItems.unshift({ keyword: schemaKeywords.min, args: min });
|
|
359
359
|
}
|
|
360
360
|
if (nullable) {
|
|
@@ -388,7 +388,7 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
388
388
|
].filter(Boolean);
|
|
389
389
|
}
|
|
390
390
|
if (schema.oneOf) {
|
|
391
|
-
const schemaWithoutOneOf = { ...schema, oneOf:
|
|
391
|
+
const schemaWithoutOneOf = { ...schema, oneOf: void 0 };
|
|
392
392
|
const union = {
|
|
393
393
|
keyword: schemaKeywords.union,
|
|
394
394
|
args: schema.oneOf.map((item) => {
|
|
@@ -411,7 +411,7 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
411
411
|
return [union, ...baseItems];
|
|
412
412
|
}
|
|
413
413
|
if (schema.anyOf) {
|
|
414
|
-
const schemaWithoutAnyOf = { ...schema, anyOf:
|
|
414
|
+
const schemaWithoutAnyOf = { ...schema, anyOf: void 0 };
|
|
415
415
|
const union = {
|
|
416
416
|
keyword: schemaKeywords.union,
|
|
417
417
|
args: schema.anyOf.map((item) => {
|
|
@@ -437,7 +437,7 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
437
437
|
return [union, ...baseItems];
|
|
438
438
|
}
|
|
439
439
|
if (schema.allOf) {
|
|
440
|
-
const schemaWithoutAllOf = { ...schema, allOf:
|
|
440
|
+
const schemaWithoutAllOf = { ...schema, allOf: void 0 };
|
|
441
441
|
const and = {
|
|
442
442
|
keyword: schemaKeywords.and,
|
|
443
443
|
args: schema.allOf.map((item) => {
|
|
@@ -477,6 +477,9 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
477
477
|
return [and, ...baseItems];
|
|
478
478
|
}
|
|
479
479
|
if (schema.enum) {
|
|
480
|
+
if (options.enumSuffix === "") {
|
|
481
|
+
throw new Error("EnumSuffix set to an empty string does not work");
|
|
482
|
+
}
|
|
480
483
|
const enumName = utils.getUniqueName(transformers.pascalCase([parentName, name, options.enumSuffix].join(" ")), this.#getUsedEnumNames({ schema, name }));
|
|
481
484
|
const typeName = this.context.pluginManager.resolveName({
|
|
482
485
|
name: enumName,
|
|
@@ -580,8 +583,8 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
580
583
|
}
|
|
581
584
|
if ("prefixItems" in schema) {
|
|
582
585
|
const prefixItems = schema.prefixItems;
|
|
583
|
-
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ??
|
|
584
|
-
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ??
|
|
586
|
+
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ?? void 0;
|
|
587
|
+
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? void 0;
|
|
585
588
|
return [
|
|
586
589
|
{
|
|
587
590
|
keyword: schemaKeywords.tuple,
|
|
@@ -680,8 +683,8 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
680
683
|
return baseItems;
|
|
681
684
|
}
|
|
682
685
|
if ("items" in schema || schema.type === "array") {
|
|
683
|
-
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ??
|
|
684
|
-
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ??
|
|
686
|
+
const min2 = schema.minimum ?? schema.minLength ?? schema.minItems ?? void 0;
|
|
687
|
+
const max2 = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? void 0;
|
|
685
688
|
const items = this.parse({ schema: "items" in schema ? schema.items : [], name, parentName });
|
|
686
689
|
const unique = !!schema.uniqueItems;
|
|
687
690
|
return [
|
|
@@ -772,5 +775,5 @@ var SchemaGenerator = class _SchemaGenerator extends core.BaseGenerator {
|
|
|
772
775
|
exports.SchemaGenerator = SchemaGenerator;
|
|
773
776
|
exports.isKeyword = isKeyword;
|
|
774
777
|
exports.schemaKeywords = schemaKeywords;
|
|
775
|
-
//# sourceMappingURL=chunk-
|
|
776
|
-
//# sourceMappingURL=chunk-
|
|
778
|
+
//# sourceMappingURL=chunk-WZRTTAGB.cjs.map
|
|
779
|
+
//# sourceMappingURL=chunk-WZRTTAGB.cjs.map
|