@kubb/plugin-oas 3.0.0-alpha.8 → 3.0.0-alpha.9
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-DeXrfGDC.d.ts → OperationGenerator-By5WOmWB.d.ts} +19 -12
- package/dist/{OperationGenerator-DhJ0MBKc.d.cts → OperationGenerator-Gd1X7wUz.d.cts} +19 -12
- package/dist/{chunk-VSVVTCQB.cjs → chunk-IAUV3UKH.cjs} +11 -12
- package/dist/chunk-IAUV3UKH.cjs.map +1 -0
- package/dist/{chunk-MUI5DWM3.js → chunk-M347763D.js} +12 -13
- package/dist/{chunk-MUI5DWM3.js.map → chunk-M347763D.js.map} +1 -1
- package/dist/components.cjs +2 -2
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/hooks.cjs +6 -6
- package/dist/hooks.js +1 -1
- package/dist/index.cjs +17 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +5 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/package.json +9 -9
- package/src/OperationGenerator.ts +14 -9
- package/src/SchemaGenerator.ts +12 -14
- package/src/{parser.tsx → generator.tsx} +12 -8
- package/src/index.ts +3 -3
- package/src/utils/index.ts +2 -0
- package/dist/chunk-VSVVTCQB.cjs.map +0 -1
|
@@ -3155,12 +3155,12 @@ function isKeyword(meta, keyword) {
|
|
|
3155
3155
|
|
|
3156
3156
|
// src/SchemaGenerator.ts
|
|
3157
3157
|
init_esm_shims();
|
|
3158
|
-
import {
|
|
3158
|
+
import { BaseGenerator } from "@kubb/core";
|
|
3159
3159
|
import transformers, { pascalCase } from "@kubb/core/transformers";
|
|
3160
3160
|
import { getUniqueName } from "@kubb/core/utils";
|
|
3161
3161
|
import { isReference } from "@kubb/oas";
|
|
3162
3162
|
import { isDeepEqual, isNumber, uniqueWith } from "remeda";
|
|
3163
|
-
var SchemaGenerator = class _SchemaGenerator extends
|
|
3163
|
+
var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
|
|
3164
3164
|
// Collect the types of all referenced schemas, so we can export them later
|
|
3165
3165
|
refs = {};
|
|
3166
3166
|
// Keep track of already used type aliases
|
|
@@ -3404,11 +3404,6 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
|
|
|
3404
3404
|
const options = this.#getOptions({ schema: _schema, name });
|
|
3405
3405
|
const unknownReturn = this.#getUnknownReturn({ schema: _schema, name });
|
|
3406
3406
|
const { schema, version } = this.#getParsedSchemaObject(_schema);
|
|
3407
|
-
const resolvedName = this.context.pluginManager.resolveName({
|
|
3408
|
-
name: `${parentName || ""} ${name}`,
|
|
3409
|
-
pluginKey: this.context.plugin.key,
|
|
3410
|
-
type: "type"
|
|
3411
|
-
});
|
|
3412
3407
|
if (!schema) {
|
|
3413
3408
|
return [{ keyword: unknownReturn }];
|
|
3414
3409
|
}
|
|
@@ -3430,12 +3425,16 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
|
|
|
3430
3425
|
keyword: schemaKeywords.default,
|
|
3431
3426
|
args: transformers.stringify(schema.default)
|
|
3432
3427
|
});
|
|
3433
|
-
}
|
|
3434
|
-
if (typeof schema.default === "boolean") {
|
|
3428
|
+
} else if (typeof schema.default === "boolean") {
|
|
3435
3429
|
baseItems.push({
|
|
3436
3430
|
keyword: schemaKeywords.default,
|
|
3437
3431
|
args: schema.default ?? false
|
|
3438
3432
|
});
|
|
3433
|
+
} else {
|
|
3434
|
+
baseItems.push({
|
|
3435
|
+
keyword: schemaKeywords.default,
|
|
3436
|
+
args: schema.default
|
|
3437
|
+
});
|
|
3439
3438
|
}
|
|
3440
3439
|
}
|
|
3441
3440
|
if (schema.description) {
|
|
@@ -3757,7 +3756,7 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
|
|
|
3757
3756
|
}
|
|
3758
3757
|
return [{ keyword: unknownReturn }];
|
|
3759
3758
|
}
|
|
3760
|
-
async build(...
|
|
3759
|
+
async build(...generators) {
|
|
3761
3760
|
const { oas, contentType, include } = this.context;
|
|
3762
3761
|
const schemas = getSchemas({ oas, contentType, includes: include });
|
|
3763
3762
|
const promises = Object.entries(schemas).reduce((acc, [name, schema]) => {
|
|
@@ -3769,8 +3768,8 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
|
|
|
3769
3768
|
if (promiseOperation) {
|
|
3770
3769
|
acc.push(promiseOperation);
|
|
3771
3770
|
}
|
|
3772
|
-
|
|
3773
|
-
const promise =
|
|
3771
|
+
generators?.forEach((generator) => {
|
|
3772
|
+
const promise = generator.schema?.({
|
|
3774
3773
|
instance: this,
|
|
3775
3774
|
name,
|
|
3776
3775
|
schema,
|
|
@@ -3963,4 +3962,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
3963
3962
|
* LICENSE file in the root directory of this source tree.
|
|
3964
3963
|
*)
|
|
3965
3964
|
*/
|
|
3966
|
-
//# sourceMappingURL=chunk-
|
|
3965
|
+
//# sourceMappingURL=chunk-M347763D.js.map
|