@kubb/plugin-ts 3.0.0-alpha.2 → 3.0.0-alpha.21
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/README.md +13 -4
- package/dist/chunk-3IKQZT26.cjs +2541 -0
- package/dist/chunk-3IKQZT26.cjs.map +1 -0
- package/dist/chunk-CAATRNVS.js +2514 -0
- package/dist/chunk-CAATRNVS.js.map +1 -0
- package/dist/chunk-CPJWNK44.js +307 -0
- package/dist/chunk-CPJWNK44.js.map +1 -0
- package/dist/chunk-YLKAQOZ5.cjs +336 -0
- package/dist/chunk-YLKAQOZ5.cjs.map +1 -0
- package/dist/components.cjs +11 -6
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +14 -44
- package/dist/components.d.ts +14 -44
- package/dist/components.js +2 -10
- package/dist/components.js.map +1 -1
- package/dist/generators.cjs +17 -0
- package/dist/generators.cjs.map +1 -0
- package/dist/generators.d.cts +10 -0
- package/dist/generators.d.ts +10 -0
- package/dist/generators.js +4 -0
- package/dist/generators.js.map +1 -0
- package/dist/index.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -122
- package/dist/index.d.ts +4 -122
- package/dist/index.js +3 -8
- package/dist/index.js.map +1 -1
- package/dist/types-W01J9acJ.d.cts +106 -0
- package/dist/types-W01J9acJ.d.ts +106 -0
- package/package.json +21 -15
- package/src/components/OasType.tsx +11 -58
- package/src/components/Type.tsx +133 -0
- package/src/components/index.ts +1 -2
- package/src/generators/__snapshots__/bodyUploadFileApiAssetsPost.ts +6 -0
- package/src/generators/__snapshots__/catTypeAsConst.ts +11 -0
- package/src/generators/__snapshots__/createPet.ts +34 -0
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +34 -0
- package/src/generators/__snapshots__/deletePet.ts +5 -0
- package/src/generators/__snapshots__/dogTypeAsConst.ts +11 -0
- package/src/generators/__snapshots__/enumAllOf.ts +10 -0
- package/src/generators/__snapshots__/enumArray.ts +19 -0
- package/src/generators/__snapshots__/enumInObject.ts +13 -0
- package/src/generators/__snapshots__/enumItems.ts +8 -0
- package/src/generators/__snapshots__/enumNames.ts +6 -0
- package/src/generators/__snapshots__/enumNamesConst.ts +6 -0
- package/src/generators/__snapshots__/enumNamesLiteral.ts +3 -0
- package/src/generators/__snapshots__/enumNamesPascalConst.ts +8 -0
- package/src/generators/__snapshots__/enumNamesType.ts +8 -0
- package/src/generators/__snapshots__/enumNullableMember.ts +8 -0
- package/src/generators/__snapshots__/enumNullableType.ts +8 -0
- package/src/generators/__snapshots__/enumString.ts +10 -0
- package/src/generators/__snapshots__/enumVarNamesType.ts +8 -0
- package/src/generators/__snapshots__/getPets.ts +27 -0
- package/src/generators/__snapshots__/mixedValueTypeConst.ts +9 -0
- package/src/generators/__snapshots__/nullConstNull.ts +6 -0
- package/src/generators/__snapshots__/numberValueConst.ts +9 -0
- package/src/generators/__snapshots__/petMapper.ts +15 -0
- package/src/generators/__snapshots__/petQuestionToken.ts +15 -0
- package/src/generators/__snapshots__/petQuestionTokenAndUndefined.ts +15 -0
- package/src/generators/__snapshots__/petUndefined.ts +15 -0
- package/src/generators/__snapshots__/pets.ts +14 -0
- package/src/generators/__snapshots__/petsStoreDiscriminator.ts +13 -0
- package/src/generators/__snapshots__/petsStoreRef.ts +1 -0
- package/src/generators/__snapshots__/plainDateDate.ts +1 -0
- package/src/generators/__snapshots__/plainDateString.ts +1 -0
- package/src/generators/__snapshots__/plainEmail.ts +1 -0
- package/src/generators/__snapshots__/plainFile.ts +1 -0
- package/src/generators/__snapshots__/plainTimeDate.ts +1 -0
- package/src/generators/__snapshots__/plainUuid.ts +1 -0
- package/src/generators/__snapshots__/showPetById.ts +32 -0
- package/src/generators/__snapshots__/stringValueConst.ts +9 -0
- package/src/generators/index.ts +2 -0
- package/src/generators/oasGenerator.tsx +29 -0
- package/src/generators/typeGenerator.tsx +200 -0
- package/src/parser/index.ts +2 -1
- package/src/plugin.ts +21 -20
- package/src/types.ts +9 -35
- package/dist/chunk-JF3PKBEA.cjs +0 -608
- package/dist/chunk-JF3PKBEA.cjs.map +0 -1
- package/dist/chunk-PU22CLWV.js +0 -608
- package/dist/chunk-PU22CLWV.js.map +0 -1
- package/dist/oas.cjs +0 -1
- package/dist/oas.cjs.map +0 -1
- package/dist/oas.d.cts +0 -1
- package/dist/oas.d.ts +0 -1
- package/dist/oas.js +0 -1
- package/dist/oas.js.map +0 -1
- package/src/OperationGenerator.tsx +0 -49
- package/src/SchemaGenerator.tsx +0 -31
- package/src/components/OperationSchema.tsx +0 -161
- package/src/components/Schema.tsx +0 -135
- package/src/components/__snapshots__/Schema/pets.ts +0 -23
- package/src/components/__snapshots__/Schema/showPetById.ts +0 -28
- package/src/oas/index.ts +0 -1
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk3IKQZT26_cjs = require('./chunk-3IKQZT26.cjs');
|
|
4
|
+
var transformers = require('@kubb/core/transformers');
|
|
5
|
+
var parserTs = require('@kubb/parser-ts');
|
|
6
|
+
var factory = require('@kubb/parser-ts/factory');
|
|
7
|
+
var pluginOas = require('@kubb/plugin-oas');
|
|
8
|
+
var components = require('@kubb/plugin-oas/components');
|
|
9
|
+
var hooks = require('@kubb/plugin-oas/hooks');
|
|
10
|
+
var path = require('path');
|
|
11
|
+
var core = require('@kubb/core');
|
|
12
|
+
var utils = require('@kubb/core/utils');
|
|
13
|
+
var react = require('@kubb/react');
|
|
14
|
+
var jsxRuntime = require('@kubb/react/jsx-runtime');
|
|
15
|
+
|
|
16
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
|
|
18
|
+
function _interopNamespace(e) {
|
|
19
|
+
if (e && e.__esModule) return e;
|
|
20
|
+
var n = Object.create(null);
|
|
21
|
+
if (e) {
|
|
22
|
+
Object.keys(e).forEach(function (k) {
|
|
23
|
+
if (k !== 'default') {
|
|
24
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return e[k]; }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
n.default = e;
|
|
33
|
+
return Object.freeze(n);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var transformers__default = /*#__PURE__*/_interopDefault(transformers);
|
|
37
|
+
var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
|
|
38
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
39
|
+
|
|
40
|
+
// src/generators/index.ts
|
|
41
|
+
chunk3IKQZT26_cjs.init_cjs_shims();
|
|
42
|
+
|
|
43
|
+
// src/generators/typeGenerator.tsx
|
|
44
|
+
chunk3IKQZT26_cjs.init_cjs_shims();
|
|
45
|
+
|
|
46
|
+
// src/index.ts
|
|
47
|
+
chunk3IKQZT26_cjs.init_cjs_shims();
|
|
48
|
+
|
|
49
|
+
// src/plugin.ts
|
|
50
|
+
chunk3IKQZT26_cjs.init_cjs_shims();
|
|
51
|
+
var pluginTsName = "plugin-ts";
|
|
52
|
+
var pluginTs = core.createPlugin((options) => {
|
|
53
|
+
const {
|
|
54
|
+
output = { path: "types" },
|
|
55
|
+
group,
|
|
56
|
+
exclude = [],
|
|
57
|
+
include,
|
|
58
|
+
override = [],
|
|
59
|
+
enumType = "asConst",
|
|
60
|
+
enumSuffix = "",
|
|
61
|
+
dateType = "string",
|
|
62
|
+
unknownType = "any",
|
|
63
|
+
optionalType = "questionToken",
|
|
64
|
+
transformers: transformers2 = {},
|
|
65
|
+
oasType = false,
|
|
66
|
+
mapper = {}
|
|
67
|
+
} = options;
|
|
68
|
+
const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`;
|
|
69
|
+
return {
|
|
70
|
+
name: pluginTsName,
|
|
71
|
+
options: {
|
|
72
|
+
output: {
|
|
73
|
+
exportType: "barrelNamed",
|
|
74
|
+
...output
|
|
75
|
+
},
|
|
76
|
+
transformers: transformers2,
|
|
77
|
+
dateType,
|
|
78
|
+
optionalType,
|
|
79
|
+
oasType,
|
|
80
|
+
enumType,
|
|
81
|
+
enumSuffix,
|
|
82
|
+
// keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)
|
|
83
|
+
usedEnumNames: {},
|
|
84
|
+
unknownType,
|
|
85
|
+
override,
|
|
86
|
+
mapper
|
|
87
|
+
},
|
|
88
|
+
pre: [pluginOas.pluginOasName],
|
|
89
|
+
resolvePath(baseName, pathMode, options2) {
|
|
90
|
+
const root = path__default.default.resolve(this.config.root, this.config.output.path);
|
|
91
|
+
const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
|
|
92
|
+
if (mode === "single") {
|
|
93
|
+
return path__default.default.resolve(root, output.path);
|
|
94
|
+
}
|
|
95
|
+
if (options2?.tag && group?.type === "tag") {
|
|
96
|
+
const tag = transformers.camelCase(options2.tag);
|
|
97
|
+
return path__default.default.resolve(root, utils.renderTemplate(template, { tag }), baseName);
|
|
98
|
+
}
|
|
99
|
+
return path__default.default.resolve(root, output.path, baseName);
|
|
100
|
+
},
|
|
101
|
+
resolveName(name, type) {
|
|
102
|
+
const resolvedName = transformers.pascalCase(name, { isFile: type === "file" });
|
|
103
|
+
if (type) {
|
|
104
|
+
return transformers2?.name?.(resolvedName, type) || resolvedName;
|
|
105
|
+
}
|
|
106
|
+
return resolvedName;
|
|
107
|
+
},
|
|
108
|
+
async buildStart() {
|
|
109
|
+
const [swaggerPlugin] = core.PluginManager.getDependedPlugins(this.plugins, [pluginOas.pluginOasName]);
|
|
110
|
+
const oas = await swaggerPlugin.context.getOas();
|
|
111
|
+
const root = path__default.default.resolve(this.config.root, this.config.output.path);
|
|
112
|
+
const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
|
|
113
|
+
const schemaGenerator = new pluginOas.SchemaGenerator(this.plugin.options, {
|
|
114
|
+
oas,
|
|
115
|
+
pluginManager: this.pluginManager,
|
|
116
|
+
plugin: this.plugin,
|
|
117
|
+
contentType: swaggerPlugin.context.contentType,
|
|
118
|
+
include: void 0,
|
|
119
|
+
override,
|
|
120
|
+
mode,
|
|
121
|
+
output: output.path
|
|
122
|
+
});
|
|
123
|
+
const schemaFiles = await schemaGenerator.build(...[typeGenerator, oasType === "infer" ? oasGenerator : void 0].filter(Boolean));
|
|
124
|
+
await this.addFile(...schemaFiles);
|
|
125
|
+
const operationGenerator = new pluginOas.OperationGenerator(this.plugin.options, {
|
|
126
|
+
oas,
|
|
127
|
+
pluginManager: this.pluginManager,
|
|
128
|
+
plugin: this.plugin,
|
|
129
|
+
contentType: swaggerPlugin.context.contentType,
|
|
130
|
+
exclude,
|
|
131
|
+
include,
|
|
132
|
+
override,
|
|
133
|
+
mode
|
|
134
|
+
});
|
|
135
|
+
const operationFiles = await operationGenerator.build(...[typeGenerator, oasType === "infer" ? oasGenerator : void 0].filter(Boolean));
|
|
136
|
+
await this.addFile(...operationFiles);
|
|
137
|
+
if (this.config.output.exportType) {
|
|
138
|
+
const barrelFiles = await this.fileManager.getBarrelFiles({
|
|
139
|
+
root,
|
|
140
|
+
output,
|
|
141
|
+
files: this.fileManager.files,
|
|
142
|
+
meta: {
|
|
143
|
+
pluginKey: this.plugin.key
|
|
144
|
+
},
|
|
145
|
+
logger: this.logger
|
|
146
|
+
});
|
|
147
|
+
await this.addFile(...barrelFiles);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
function printCombinedSchema({ name, schemas, pluginManager }) {
|
|
153
|
+
const properties = {};
|
|
154
|
+
if (schemas.response) {
|
|
155
|
+
const identifier = pluginManager.resolveName({
|
|
156
|
+
name: schemas.response.name,
|
|
157
|
+
pluginKey: [pluginTsName],
|
|
158
|
+
type: "function"
|
|
159
|
+
});
|
|
160
|
+
properties["response"] = factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier(identifier), void 0);
|
|
161
|
+
}
|
|
162
|
+
if (schemas.request) {
|
|
163
|
+
const identifier = pluginManager.resolveName({
|
|
164
|
+
name: schemas.request.name,
|
|
165
|
+
pluginKey: [pluginTsName],
|
|
166
|
+
type: "function"
|
|
167
|
+
});
|
|
168
|
+
properties["request"] = factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier(identifier), void 0);
|
|
169
|
+
}
|
|
170
|
+
if (schemas.pathParams) {
|
|
171
|
+
const identifier = pluginManager.resolveName({
|
|
172
|
+
name: schemas.pathParams.name,
|
|
173
|
+
pluginKey: [pluginTsName],
|
|
174
|
+
type: "function"
|
|
175
|
+
});
|
|
176
|
+
properties["pathParams"] = factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier(identifier), void 0);
|
|
177
|
+
}
|
|
178
|
+
if (schemas.queryParams) {
|
|
179
|
+
const identifier = pluginManager.resolveName({
|
|
180
|
+
name: schemas.queryParams.name,
|
|
181
|
+
pluginKey: [pluginTsName],
|
|
182
|
+
type: "function"
|
|
183
|
+
});
|
|
184
|
+
properties["queryParams"] = factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier(identifier), void 0);
|
|
185
|
+
}
|
|
186
|
+
if (schemas.headerParams) {
|
|
187
|
+
const identifier = pluginManager.resolveName({
|
|
188
|
+
name: schemas.headerParams.name,
|
|
189
|
+
pluginKey: [pluginTsName],
|
|
190
|
+
type: "function"
|
|
191
|
+
});
|
|
192
|
+
properties["headerParams"] = factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier(identifier), void 0);
|
|
193
|
+
}
|
|
194
|
+
if (schemas.errors) {
|
|
195
|
+
properties["errors"] = factory__namespace.createUnionDeclaration({
|
|
196
|
+
nodes: schemas.errors.map((error) => {
|
|
197
|
+
const identifier = pluginManager.resolveName({
|
|
198
|
+
name: error.name,
|
|
199
|
+
pluginKey: [pluginTsName],
|
|
200
|
+
type: "function"
|
|
201
|
+
});
|
|
202
|
+
return factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier(identifier), void 0);
|
|
203
|
+
})
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const namespaceNode = factory__namespace.createTypeAliasDeclaration({
|
|
207
|
+
name,
|
|
208
|
+
type: factory__namespace.createTypeLiteralNode(
|
|
209
|
+
Object.keys(properties).map((key) => {
|
|
210
|
+
const type = properties[key];
|
|
211
|
+
if (!type) {
|
|
212
|
+
return void 0;
|
|
213
|
+
}
|
|
214
|
+
return factory__namespace.createPropertySignature({
|
|
215
|
+
name: transformers__default.default.pascalCase(key),
|
|
216
|
+
type
|
|
217
|
+
});
|
|
218
|
+
}).filter(Boolean)
|
|
219
|
+
),
|
|
220
|
+
modifiers: [factory__namespace.modifiers.export]
|
|
221
|
+
});
|
|
222
|
+
return parserTs.print([namespaceNode]);
|
|
223
|
+
}
|
|
224
|
+
var typeGenerator = pluginOas.createReactGenerator({
|
|
225
|
+
name: "typescript",
|
|
226
|
+
Operation({ operation, options }) {
|
|
227
|
+
const { mapper, enumType, optionalType } = options;
|
|
228
|
+
const { plugin, pluginManager, mode } = react.useApp();
|
|
229
|
+
const oas = hooks.useOas();
|
|
230
|
+
const { getSchemas, getFile, getName } = hooks.useOperationManager();
|
|
231
|
+
const schemaManager = hooks.useSchemaManager();
|
|
232
|
+
const file = getFile(operation);
|
|
233
|
+
const schemas = getSchemas(operation);
|
|
234
|
+
const type = getName(operation, { type: "function", pluginKey: [pluginTsName] });
|
|
235
|
+
const combinedSchemaName = operation.method === "get" ? `${type}Query` : `${type}Mutation`;
|
|
236
|
+
const schemaGenerator = new pluginOas.SchemaGenerator(options, {
|
|
237
|
+
oas,
|
|
238
|
+
plugin,
|
|
239
|
+
pluginManager,
|
|
240
|
+
mode,
|
|
241
|
+
override: options.override
|
|
242
|
+
});
|
|
243
|
+
const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean);
|
|
244
|
+
const mapOperationSchema = ({ name, schema, description, keysToOmit, ...options2 }, i) => {
|
|
245
|
+
const tree = schemaGenerator.parse({ schema, name });
|
|
246
|
+
const imports = schemaManager.getImports(tree);
|
|
247
|
+
const type2 = {
|
|
248
|
+
name: schemaManager.getName(name, { type: "type" }),
|
|
249
|
+
typedName: schemaManager.getName(name, { type: "type" }),
|
|
250
|
+
file: schemaManager.getFile(options2.operationName || name, { tag: options2.operation?.getTags()[0]?.name })
|
|
251
|
+
};
|
|
252
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(components.Oas.Schema, { name, value: schema, tree, children: [
|
|
253
|
+
mode === "split" && imports.map((imp, index) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { root: file.path, path: imp.path, name: imp.name, isTypeOnly: true }, index)),
|
|
254
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
255
|
+
chunk3IKQZT26_cjs.Type,
|
|
256
|
+
{
|
|
257
|
+
name: type2.name,
|
|
258
|
+
typedName: type2.typedName,
|
|
259
|
+
description,
|
|
260
|
+
tree,
|
|
261
|
+
mapper,
|
|
262
|
+
enumType,
|
|
263
|
+
optionalType,
|
|
264
|
+
keysToOmit
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
] }, i);
|
|
268
|
+
};
|
|
269
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: plugin.options.output?.banner, footer: plugin.options.output?.footer, children: [
|
|
270
|
+
operationSchemas.map(mapOperationSchema),
|
|
271
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name: combinedSchemaName, isExportable: true, isIndexable: true, isTypeOnly: true, children: printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager }) })
|
|
272
|
+
] });
|
|
273
|
+
},
|
|
274
|
+
Schema({ schema, options }) {
|
|
275
|
+
const { mapper, enumType, optionalType } = options;
|
|
276
|
+
const {
|
|
277
|
+
mode,
|
|
278
|
+
plugin: {
|
|
279
|
+
options: { output }
|
|
280
|
+
}
|
|
281
|
+
} = react.useApp();
|
|
282
|
+
const { getName, getImports, getFile } = hooks.useSchemaManager();
|
|
283
|
+
const imports = getImports(schema.tree);
|
|
284
|
+
if (enumType === "asPascalConst") {
|
|
285
|
+
console.warn(`enumType '${enumType}' is deprecated`);
|
|
286
|
+
}
|
|
287
|
+
const type = {
|
|
288
|
+
name: getName(schema.name, { type: "function" }),
|
|
289
|
+
typedName: getName(schema.name, { type: "type" }),
|
|
290
|
+
file: getFile(schema.name)
|
|
291
|
+
};
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: type.file.baseName, path: type.file.path, meta: type.file.meta, banner: output?.banner, footer: output?.footer, children: [
|
|
293
|
+
mode === "split" && imports.map((imp, index) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { root: type.file.path, path: imp.path, name: imp.name, isTypeOnly: true }, index)),
|
|
294
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
295
|
+
chunk3IKQZT26_cjs.Type,
|
|
296
|
+
{
|
|
297
|
+
name: type.name,
|
|
298
|
+
typedName: type.typedName,
|
|
299
|
+
description: schema.value.description,
|
|
300
|
+
tree: schema.tree,
|
|
301
|
+
mapper,
|
|
302
|
+
enumType,
|
|
303
|
+
optionalType
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] });
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// src/generators/oasGenerator.tsx
|
|
311
|
+
chunk3IKQZT26_cjs.init_cjs_shims();
|
|
312
|
+
var oasGenerator = pluginOas.createReactGenerator({
|
|
313
|
+
name: "oas",
|
|
314
|
+
Operations() {
|
|
315
|
+
const {
|
|
316
|
+
pluginManager,
|
|
317
|
+
plugin: {
|
|
318
|
+
options: { output },
|
|
319
|
+
key: pluginKey
|
|
320
|
+
}
|
|
321
|
+
} = react.useApp();
|
|
322
|
+
const oas = hooks.useOas();
|
|
323
|
+
const file = pluginManager.getFile({ name: "oas", extName: ".ts", pluginKey });
|
|
324
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: output?.banner, footer: output?.footer, children: [
|
|
325
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["Infer"], path: "@kubb/oas", isTypeOnly: true }),
|
|
326
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3IKQZT26_cjs.OasType, { name: "oas", typeName: "Oas", api: oas.api })
|
|
327
|
+
] });
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
exports.oasGenerator = oasGenerator;
|
|
332
|
+
exports.pluginTs = pluginTs;
|
|
333
|
+
exports.pluginTsName = pluginTsName;
|
|
334
|
+
exports.typeGenerator = typeGenerator;
|
|
335
|
+
//# sourceMappingURL=chunk-YLKAQOZ5.cjs.map
|
|
336
|
+
//# sourceMappingURL=chunk-YLKAQOZ5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generators/index.ts","../src/generators/typeGenerator.tsx","../src/index.ts","../src/plugin.ts","../src/generators/oasGenerator.tsx"],"names":["init_cjs_shims","createPlugin","transformers","pluginOasName","options","path","FileManager","camelCase","renderTemplate","pascalCase","PluginManager","SchemaGenerator","OperationGenerator","factory","print","createReactGenerator","useApp","useOas","useOperationManager","useSchemaManager","type","Oas","jsx","File","Type","jsxs","OasType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,gCAAA,EAAA,CAAA;;;ACAAA,gCAAA,EAAA,CAAA;;;ACAAA,gCAAA,EAAA,CAAA;;;ACAAA,gCAAA,EAAA,CAAA;AAYO,IAAM,YAAe,GAAA,YAAA;AAEf,IAAA,QAAA,GAAWC,iBAAuB,CAAA,CAAC,OAAY,KAAA;AAC1D,EAAM,MAAA;AAAA,IACJ,MAAA,GAAS,EAAE,IAAA,EAAM,OAAQ,EAAA;AAAA,IACzB,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IAC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AA+B,CAAA;AAAA,EACzD,IAAM,EAAA,KAAA;AAAA,EACN,UAAa,GAAA;AACX,IAAM,MAAA;AAAA,MACJ,aAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,OAAA,EAAS,EAAE,MAAO,EAAA;AAAA,QAClB,GAAK,EAAA,SAAA;AAAA,OACP;AAAA,QACEC,YAAiB,EAAA,CAAA;AACrB,IAAA,MAAM,MAAMC,YAAO,EAAA,CAAA;AAEnB,IAAM,MAAA,IAAA,GAAO,cAAc,OAAQ,CAAA,EAAE,MAAM,KAAO,EAAA,OAAA,EAAS,KAAO,EAAA,SAAA,EAAW,CAAA,CAAA;AAE7E,IAAA,uBACEQ,eAACF,CAAAA,UAAAA,EAAA,EAAK,QAAU,EAAA,IAAA,CAAK,UAAU,IAAM,EAAA,IAAA,CAAK,IAAM,EAAA,IAAA,EAAM,KAAK,IAAM,EAAA,MAAA,EAAQ,QAAQ,MAAQ,EAAA,MAAA,EAAQ,QAAQ,MACvG,EAAA,QAAA,EAAA;AAAA,sBAAAD,cAAAA,CAACC,UAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,OAAO,CAAG,EAAA,IAAA,EAAK,WAAY,EAAA,UAAA,EAAU,IAAC,EAAA,CAAA;AAAA,sBAE1DD,eAACI,yBAAQ,EAAA,EAAA,IAAA,EAAM,OAAO,QAAU,EAAA,KAAA,EAAO,GAAK,EAAA,GAAA,CAAI,GAAK,EAAA,CAAA;AAAA,KACvD,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,CAAC","file":"chunk-YLKAQOZ5.cjs","sourcesContent":["export { typeGenerator } from './typeGenerator.tsx'\nexport { oasGenerator } from './oasGenerator.tsx'\n","import type { PluginManager } from '@kubb/core'\nimport transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { type OperationSchema as OperationSchemaType, type OperationSchemas, SchemaGenerator, createReactGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport type ts from 'typescript'\nimport { Type } from '../components'\nimport type { PluginTs } from '../types'\n\nfunction printCombinedSchema({ name, schemas, pluginManager }: { name: string; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n const identifier = pluginManager.resolveName({\n name: schemas.response.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['response'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map((error) => {\n const identifier = pluginManager.resolveName({\n name: error.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name,\n type: factory.createTypeLiteralNode(\n Object.keys(properties)\n .map((key) => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature({\n name: transformers.pascalCase(key),\n type,\n })\n })\n .filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print([namespaceNode])\n}\n\nexport const typeGenerator = createReactGenerator<PluginTs>({\n name: 'typescript',\n Operation({ operation, options }) {\n const { mapper, enumType, optionalType } = options\n\n const { plugin, pluginManager, mode } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName } = useOperationManager()\n const schemaManager = useSchemaManager()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const type = getName(operation, { type: 'function', pluginKey: [pluginTsName] })\n const combinedSchemaName = operation.method === 'get' ? `${type}Query` : `${type}Mutation`\n const schemaGenerator = new SchemaGenerator(options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: options.override,\n })\n\n const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]\n .flat()\n .filter(Boolean)\n\n const mapOperationSchema = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n // hack so Params can be optional when needed\n const tree = schemaGenerator.parse({ schema, name })\n const imports = schemaManager.getImports(tree)\n\n const type = {\n name: schemaManager.getName(name, { type: 'type' }),\n typedName: schemaManager.getName(name, { type: 'type' }),\n file: schemaManager.getFile(options.operationName || name, { tag: options.operation?.getTags()[0]?.name }),\n }\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={tree}>\n {mode === 'split' && imports.map((imp, index) => <File.Import key={index} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={description}\n tree={tree}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n keysToOmit={keysToOmit}\n />\n </Oas.Schema>\n )\n }\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={plugin.options.output?.banner} footer={plugin.options.output?.footer}>\n {operationSchemas.map(mapOperationSchema)}\n\n <File.Source name={combinedSchemaName} isExportable isIndexable isTypeOnly>\n {printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager })}\n </File.Source>\n </File>\n )\n },\n Schema({ schema, options }) {\n const { mapper, enumType, optionalType } = options\n const {\n mode,\n plugin: {\n options: { output },\n },\n } = useApp<PluginTs>()\n\n const { getName, getImports, getFile } = useSchemaManager()\n const imports = getImports(schema.tree)\n\n if (enumType === 'asPascalConst') {\n console.warn(`enumType '${enumType}' is deprecated`)\n }\n\n const type = {\n name: getName(schema.name, { type: 'function' }),\n typedName: getName(schema.name, { type: 'type' }),\n file: getFile(schema.name),\n }\n\n return (\n <File baseName={type.file.baseName} path={type.file.path} meta={type.file.meta} banner={output?.banner} footer={output?.footer}>\n {mode === 'split' && imports.map((imp, index) => <File.Import key={index} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={schema.value.description}\n tree={schema.tree}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n />\n </File>\n )\n },\n})\n","export { pluginTs, pluginTsName } from './plugin.ts'\nexport type { PluginTs } from './types.ts'\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { OperationGenerator, SchemaGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { oasGenerator, typeGenerator } from './generators'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = '',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n transformers = {},\n oasType = false,\n mapper = {},\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginTsName,\n options: {\n output: {\n exportType: 'barrelNamed',\n ...output,\n },\n transformers,\n dateType,\n optionalType,\n oasType,\n enumType,\n enumSuffix,\n // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)\n usedEnumNames: {},\n unknownType,\n override,\n mapper,\n },\n pre: [pluginOasName],\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = pascalCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(...[typeGenerator, oasType === 'infer' ? oasGenerator : undefined].filter(Boolean))\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(...[typeGenerator, oasType === 'infer' ? oasGenerator : undefined].filter(Boolean))\n await this.addFile(...operationFiles)\n\n if (this.config.output.exportType) {\n const barrelFiles = await this.fileManager.getBarrelFiles({\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n }\n },\n }\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { File, useApp } from '@kubb/react'\nimport { OasType } from '../components'\nimport type { PluginTs } from '../types.ts'\n\nexport const oasGenerator = createReactGenerator<PluginTs>({\n name: 'oas',\n Operations() {\n const {\n pluginManager,\n plugin: {\n options: { output },\n key: pluginKey,\n },\n } = useApp<PluginTs>()\n const oas = useOas()\n\n const file = pluginManager.getFile({ name: 'oas', extName: '.ts', pluginKey })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={output?.banner} footer={output?.footer}>\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n\n <OasType name={'oas'} typeName={'Oas'} api={oas.api} />\n </File>\n )\n },\n})\n"]}
|
package/dist/components.cjs
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunk3IKQZT26_cjs = require('./chunk-3IKQZT26.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
|
-
var _chunkJF3PKBEAcjs = require('./chunk-JF3PKBEA.cjs');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Object.defineProperty(exports, "OasType", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunk3IKQZT26_cjs.OasType; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "Type", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunk3IKQZT26_cjs.Type; }
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=components.cjs.map
|
|
11
16
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.cjs"}
|
package/dist/components.d.cts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { OasTypes } from '@kubb/oas';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { Schema } from '@kubb/plugin-oas';
|
|
4
|
+
import { P as PluginTs } from './types-W01J9acJ.cjs';
|
|
5
|
+
import '@kubb/core';
|
|
6
|
+
import 'typescript';
|
|
3
7
|
|
|
4
|
-
type
|
|
8
|
+
type Props$1 = {
|
|
5
9
|
/**
|
|
6
10
|
* Name of the function
|
|
7
11
|
*/
|
|
@@ -9,52 +13,18 @@ type TemplateProps = {
|
|
|
9
13
|
typeName: string;
|
|
10
14
|
api: OasTypes.OASDocument;
|
|
11
15
|
};
|
|
12
|
-
declare function
|
|
13
|
-
declare const defaultTemplates: {
|
|
14
|
-
readonly default: typeof Template;
|
|
15
|
-
};
|
|
16
|
-
type Props$2 = {
|
|
17
|
-
name: string;
|
|
18
|
-
typeName: string;
|
|
19
|
-
/**
|
|
20
|
-
* This will make it possible to override the default behaviour.
|
|
21
|
-
*/
|
|
22
|
-
Template?: React.ComponentType<React.ComponentProps<typeof Template>>;
|
|
23
|
-
};
|
|
24
|
-
declare function OasType({ name, typeName, Template }: Props$2): ReactNode;
|
|
25
|
-
declare namespace OasType {
|
|
26
|
-
var File: ({ name, typeName, templates }: FileProps$2) => ReactNode;
|
|
27
|
-
var templates: {
|
|
28
|
-
readonly default: typeof Template;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
type FileProps$2 = {
|
|
32
|
-
name: string;
|
|
33
|
-
typeName: string;
|
|
34
|
-
/**
|
|
35
|
-
* This will make it possible to override the default behaviour.
|
|
36
|
-
*/
|
|
37
|
-
templates?: typeof defaultTemplates;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
type Props$1 = {
|
|
41
|
-
description?: string;
|
|
42
|
-
keysToOmit?: string[];
|
|
43
|
-
};
|
|
44
|
-
declare function OperationSchema({ keysToOmit, description }: Props$1): ReactNode;
|
|
45
|
-
declare namespace OperationSchema {
|
|
46
|
-
var File: ({}: FileProps$1) => ReactNode;
|
|
47
|
-
}
|
|
48
|
-
type FileProps$1 = {};
|
|
16
|
+
declare function OasType({ name, typeName, api }: Props$1): ReactNode;
|
|
49
17
|
|
|
50
18
|
type Props = {
|
|
19
|
+
name: string;
|
|
20
|
+
typedName: string;
|
|
21
|
+
tree: Array<Schema>;
|
|
22
|
+
optionalType: PluginTs['resolvedOptions']['optionalType'];
|
|
23
|
+
enumType: PluginTs['resolvedOptions']['enumType'];
|
|
24
|
+
mapper: PluginTs['resolvedOptions']['mapper'];
|
|
51
25
|
description?: string;
|
|
52
26
|
keysToOmit?: string[];
|
|
53
27
|
};
|
|
54
|
-
declare function
|
|
55
|
-
declare namespace Schema {
|
|
56
|
-
var File: ({}: FileProps) => ReactNode;
|
|
57
|
-
}
|
|
58
|
-
type FileProps = {};
|
|
28
|
+
declare function Type({ name, typedName, tree, keysToOmit, optionalType, enumType, mapper, description }: Props): ReactNode;
|
|
59
29
|
|
|
60
|
-
export { OasType,
|
|
30
|
+
export { OasType, Type };
|
package/dist/components.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { OasTypes } from '@kubb/oas';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { Schema } from '@kubb/plugin-oas';
|
|
4
|
+
import { P as PluginTs } from './types-W01J9acJ.js';
|
|
5
|
+
import '@kubb/core';
|
|
6
|
+
import 'typescript';
|
|
3
7
|
|
|
4
|
-
type
|
|
8
|
+
type Props$1 = {
|
|
5
9
|
/**
|
|
6
10
|
* Name of the function
|
|
7
11
|
*/
|
|
@@ -9,52 +13,18 @@ type TemplateProps = {
|
|
|
9
13
|
typeName: string;
|
|
10
14
|
api: OasTypes.OASDocument;
|
|
11
15
|
};
|
|
12
|
-
declare function
|
|
13
|
-
declare const defaultTemplates: {
|
|
14
|
-
readonly default: typeof Template;
|
|
15
|
-
};
|
|
16
|
-
type Props$2 = {
|
|
17
|
-
name: string;
|
|
18
|
-
typeName: string;
|
|
19
|
-
/**
|
|
20
|
-
* This will make it possible to override the default behaviour.
|
|
21
|
-
*/
|
|
22
|
-
Template?: React.ComponentType<React.ComponentProps<typeof Template>>;
|
|
23
|
-
};
|
|
24
|
-
declare function OasType({ name, typeName, Template }: Props$2): ReactNode;
|
|
25
|
-
declare namespace OasType {
|
|
26
|
-
var File: ({ name, typeName, templates }: FileProps$2) => ReactNode;
|
|
27
|
-
var templates: {
|
|
28
|
-
readonly default: typeof Template;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
type FileProps$2 = {
|
|
32
|
-
name: string;
|
|
33
|
-
typeName: string;
|
|
34
|
-
/**
|
|
35
|
-
* This will make it possible to override the default behaviour.
|
|
36
|
-
*/
|
|
37
|
-
templates?: typeof defaultTemplates;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
type Props$1 = {
|
|
41
|
-
description?: string;
|
|
42
|
-
keysToOmit?: string[];
|
|
43
|
-
};
|
|
44
|
-
declare function OperationSchema({ keysToOmit, description }: Props$1): ReactNode;
|
|
45
|
-
declare namespace OperationSchema {
|
|
46
|
-
var File: ({}: FileProps$1) => ReactNode;
|
|
47
|
-
}
|
|
48
|
-
type FileProps$1 = {};
|
|
16
|
+
declare function OasType({ name, typeName, api }: Props$1): ReactNode;
|
|
49
17
|
|
|
50
18
|
type Props = {
|
|
19
|
+
name: string;
|
|
20
|
+
typedName: string;
|
|
21
|
+
tree: Array<Schema>;
|
|
22
|
+
optionalType: PluginTs['resolvedOptions']['optionalType'];
|
|
23
|
+
enumType: PluginTs['resolvedOptions']['enumType'];
|
|
24
|
+
mapper: PluginTs['resolvedOptions']['mapper'];
|
|
51
25
|
description?: string;
|
|
52
26
|
keysToOmit?: string[];
|
|
53
27
|
};
|
|
54
|
-
declare function
|
|
55
|
-
declare namespace Schema {
|
|
56
|
-
var File: ({}: FileProps) => ReactNode;
|
|
57
|
-
}
|
|
58
|
-
type FileProps = {};
|
|
28
|
+
declare function Type({ name, typedName, tree, keysToOmit, optionalType, enumType, mapper, description }: Props): ReactNode;
|
|
59
29
|
|
|
60
|
-
export { OasType,
|
|
30
|
+
export { OasType, Type };
|
package/dist/components.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
OperationSchema,
|
|
4
|
-
Schema
|
|
5
|
-
} from "./chunk-PU22CLWV.js";
|
|
6
|
-
export {
|
|
7
|
-
OasType,
|
|
8
|
-
OperationSchema,
|
|
9
|
-
Schema
|
|
10
|
-
};
|
|
1
|
+
export { OasType, Type } from './chunk-CAATRNVS.js';
|
|
2
|
+
//# sourceMappingURL=components.js.map
|
|
11
3
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkYLKAQOZ5_cjs = require('./chunk-YLKAQOZ5.cjs');
|
|
4
|
+
require('./chunk-3IKQZT26.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "oasGenerator", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkYLKAQOZ5_cjs.oasGenerator; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "typeGenerator", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkYLKAQOZ5_cjs.typeGenerator; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=generators.cjs.map
|
|
17
|
+
//# sourceMappingURL=generators.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.cjs"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _kubb_plugin_oas from '@kubb/plugin-oas';
|
|
2
|
+
import { P as PluginTs } from './types-W01J9acJ.cjs';
|
|
3
|
+
import '@kubb/core';
|
|
4
|
+
import 'typescript';
|
|
5
|
+
|
|
6
|
+
declare const typeGenerator: _kubb_plugin_oas.Generator<PluginTs>;
|
|
7
|
+
|
|
8
|
+
declare const oasGenerator: _kubb_plugin_oas.Generator<PluginTs>;
|
|
9
|
+
|
|
10
|
+
export { oasGenerator, typeGenerator };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _kubb_plugin_oas from '@kubb/plugin-oas';
|
|
2
|
+
import { P as PluginTs } from './types-W01J9acJ.js';
|
|
3
|
+
import '@kubb/core';
|
|
4
|
+
import 'typescript';
|
|
5
|
+
|
|
6
|
+
declare const typeGenerator: _kubb_plugin_oas.Generator<PluginTs>;
|
|
7
|
+
|
|
8
|
+
declare const oasGenerator: _kubb_plugin_oas.Generator<PluginTs>;
|
|
9
|
+
|
|
10
|
+
export { oasGenerator, typeGenerator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.js"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkYLKAQOZ5_cjs = require('./chunk-YLKAQOZ5.cjs');
|
|
4
|
+
require('./chunk-3IKQZT26.cjs');
|
|
3
5
|
|
|
4
|
-
var _chunkJF3PKBEAcjs = require('./chunk-JF3PKBEA.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
Object.defineProperty(exports, "pluginTs", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkYLKAQOZ5_cjs.pluginTs; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "pluginTsName", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkYLKAQOZ5_cjs.pluginTsName; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
9
17
|
//# sourceMappingURL=index.cjs.map
|