@kubb/plugin-ts 3.0.0-alpha.17 → 3.0.0-alpha.19
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 +0 -4
- package/dist/{chunk-LKQDTRGL.cjs → chunk-3EAINOIS.cjs} +29 -23
- package/dist/chunk-3EAINOIS.cjs.map +1 -0
- package/dist/{chunk-YVI4OC7Y.cjs → chunk-QMY4POF3.cjs} +4 -4
- package/dist/{chunk-YVI4OC7Y.cjs.map → chunk-QMY4POF3.cjs.map} +1 -1
- package/dist/{chunk-EWI2PAND.js → chunk-QO5MHF5I.js} +4 -4
- package/dist/{chunk-EWI2PAND.js.map → chunk-QO5MHF5I.js.map} +1 -1
- package/dist/{chunk-4UQ7WF6J.js → chunk-U3JPULJV.js} +20 -14
- package/dist/chunk-U3JPULJV.js.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.d.cts +1 -2
- package/dist/components.d.ts +1 -2
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -2
- package/dist/generators.d.ts +1 -2
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -2
- package/dist/{types-fG0pOv-_.d.cts → types-DWIokV65.d.cts} +5 -23
- package/dist/{types-fG0pOv-_.d.ts → types-DWIokV65.d.ts} +5 -23
- package/package.json +10 -12
- package/src/generators/__snapshots__/bodyUploadFileApiAssetsPost.ts +5 -5
- package/src/generators/__snapshots__/catTypeAsConst.ts +10 -10
- package/src/generators/__snapshots__/createPet.ts +26 -26
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +26 -26
- package/src/generators/__snapshots__/deletePet.ts +4 -4
- package/src/generators/__snapshots__/dogTypeAsConst.ts +10 -10
- package/src/generators/__snapshots__/enumAllOf.ts +7 -7
- package/src/generators/__snapshots__/enumArray.ts +16 -12
- package/src/generators/__snapshots__/enumInObject.ts +10 -10
- package/src/generators/__snapshots__/enumItems.ts +5 -5
- package/src/generators/__snapshots__/enumNames.ts +3 -3
- package/src/generators/__snapshots__/enumNamesConst.ts +3 -3
- package/src/generators/__snapshots__/enumNamesLiteral.ts +2 -2
- package/src/generators/__snapshots__/enumNamesPascalConst.ts +5 -5
- package/src/generators/__snapshots__/enumNamesType.ts +5 -5
- package/src/generators/__snapshots__/enumNullableMember.ts +5 -5
- package/src/generators/__snapshots__/enumNullableType.ts +5 -5
- package/src/generators/__snapshots__/enumString.ts +7 -7
- package/src/generators/__snapshots__/enumVarNamesType.ts +5 -5
- package/src/generators/__snapshots__/getPets.ts +19 -19
- package/src/generators/__snapshots__/mixedValueTypeConst.ts +6 -6
- package/src/generators/__snapshots__/nullConstNull.ts +3 -3
- package/src/generators/__snapshots__/numberValueConst.ts +6 -6
- package/src/generators/__snapshots__/petMapper.ts +14 -14
- package/src/generators/__snapshots__/petQuestionToken.ts +14 -14
- package/src/generators/__snapshots__/petQuestionTokenAndUndefined.ts +14 -14
- package/src/generators/__snapshots__/petUndefined.ts +14 -14
- package/src/generators/__snapshots__/pets.ts +13 -13
- package/src/generators/__snapshots__/petsStoreDiscriminator.ts +10 -10
- package/src/generators/__snapshots__/petsStoreRef.ts +1 -1
- package/src/generators/__snapshots__/plainDateDate.ts +1 -1
- package/src/generators/__snapshots__/plainDateString.ts +1 -1
- package/src/generators/__snapshots__/plainEmail.ts +1 -1
- package/src/generators/__snapshots__/plainFile.ts +1 -1
- package/src/generators/__snapshots__/plainTimeDate.ts +1 -1
- package/src/generators/__snapshots__/plainUuid.ts +1 -1
- package/src/generators/__snapshots__/showPetById.ts +24 -24
- package/src/generators/__snapshots__/stringValueConst.ts +6 -6
- package/src/generators/oasGenerator.tsx +7 -4
- package/src/generators/typeGenerator.tsx +14 -11
- package/src/types.ts +5 -29
- package/dist/chunk-4UQ7WF6J.js.map +0 -1
- package/dist/chunk-LKQDTRGL.cjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { init_esm_shims, Type, OasType } from './chunk-
|
|
1
|
+
import { init_esm_shims, Type, OasType } from './chunk-QO5MHF5I.js';
|
|
2
|
+
import transformers, { camelCase, pascalCase } from '@kubb/core/transformers';
|
|
3
|
+
import { print } from '@kubb/parser-ts';
|
|
4
|
+
import * as factory from '@kubb/parser-ts/factory';
|
|
2
5
|
import { pluginOasName, SchemaGenerator, OperationGenerator, createReactGenerator } from '@kubb/plugin-oas';
|
|
3
|
-
import {
|
|
6
|
+
import { Oas } from '@kubb/plugin-oas/components';
|
|
4
7
|
import { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks';
|
|
5
8
|
import path from 'node:path';
|
|
6
9
|
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|
|
7
|
-
import transformers, { camelCase, pascalCase } from '@kubb/core/transformers';
|
|
8
10
|
import { renderTemplate } from '@kubb/core/utils';
|
|
9
|
-
import {
|
|
10
|
-
import { print } from '@kubb/parser-ts';
|
|
11
|
-
import * as factory from '@kubb/parser-ts/factory';
|
|
11
|
+
import { useApp, File } from '@kubb/react';
|
|
12
12
|
import { jsxs, jsx } from '@kubb/react/jsx-runtime';
|
|
13
13
|
|
|
14
14
|
// src/generators/index.ts
|
|
@@ -240,14 +240,17 @@ var typeGenerator = createReactGenerator({
|
|
|
240
240
|
)
|
|
241
241
|
] }, i);
|
|
242
242
|
};
|
|
243
|
-
return /* @__PURE__ */ jsxs(File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
|
|
243
|
+
return /* @__PURE__ */ jsxs(File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: plugin.output?.banner, footer: plugin.output?.footer, children: [
|
|
244
244
|
operationSchemas.map(mapOperationSchema),
|
|
245
245
|
/* @__PURE__ */ jsx(File.Source, { name: combinedSchemaName, isExportable: true, isIndexable: true, isTypeOnly: true, children: printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager }) })
|
|
246
246
|
] });
|
|
247
247
|
},
|
|
248
248
|
Schema({ schema, options }) {
|
|
249
249
|
const { mapper, enumType, optionalType } = options;
|
|
250
|
-
const {
|
|
250
|
+
const {
|
|
251
|
+
mode,
|
|
252
|
+
plugin: { output }
|
|
253
|
+
} = useApp();
|
|
251
254
|
const { getName, getImports, getFile } = useSchemaManager();
|
|
252
255
|
const imports = getImports(schema.tree);
|
|
253
256
|
if (enumType === "asPascalConst") {
|
|
@@ -258,7 +261,7 @@ var typeGenerator = createReactGenerator({
|
|
|
258
261
|
typedName: getName(schema.name, { type: "type" }),
|
|
259
262
|
file: getFile(schema.name)
|
|
260
263
|
};
|
|
261
|
-
return /* @__PURE__ */ jsxs(File, { baseName: type.file.baseName, path: type.file.path, meta: type.file.meta, children: [
|
|
264
|
+
return /* @__PURE__ */ jsxs(File, { baseName: type.file.baseName, path: type.file.path, meta: type.file.meta, banner: output?.banner, footer: output?.footer, children: [
|
|
262
265
|
mode === "split" && imports.map((imp, index) => /* @__PURE__ */ jsx(File.Import, { root: type.file.path, path: imp.path, name: imp.name, isTypeOnly: true }, index)),
|
|
263
266
|
/* @__PURE__ */ jsx(
|
|
264
267
|
Type,
|
|
@@ -281,10 +284,13 @@ init_esm_shims();
|
|
|
281
284
|
var oasGenerator = createReactGenerator({
|
|
282
285
|
name: "oas",
|
|
283
286
|
Operations() {
|
|
284
|
-
const {
|
|
287
|
+
const {
|
|
288
|
+
pluginManager,
|
|
289
|
+
plugin: { output, key: pluginKey }
|
|
290
|
+
} = useApp();
|
|
285
291
|
const oas = useOas();
|
|
286
|
-
const file = pluginManager.getFile({ name: "oas", extName: ".ts", pluginKey
|
|
287
|
-
return /* @__PURE__ */ jsxs(File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
|
|
292
|
+
const file = pluginManager.getFile({ name: "oas", extName: ".ts", pluginKey });
|
|
293
|
+
return /* @__PURE__ */ jsxs(File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: output?.banner, footer: output?.footer, children: [
|
|
288
294
|
/* @__PURE__ */ jsx(File.Import, { name: ["Infer"], path: "@kubb/oas", isTypeOnly: true }),
|
|
289
295
|
/* @__PURE__ */ jsx(OasType, { name: "oas", typeName: "Oas", api: oas.api })
|
|
290
296
|
] });
|
|
@@ -292,5 +298,5 @@ var oasGenerator = createReactGenerator({
|
|
|
292
298
|
});
|
|
293
299
|
|
|
294
300
|
export { oasGenerator, pluginTs, pluginTsName, typeGenerator };
|
|
295
|
-
//# sourceMappingURL=chunk-
|
|
296
|
-
//# sourceMappingURL=chunk-
|
|
301
|
+
//# sourceMappingURL=chunk-U3JPULJV.js.map
|
|
302
|
+
//# sourceMappingURL=chunk-U3JPULJV.js.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":["transformers","options","SchemaGenerator","type","createReactGenerator","useApp","useOas","jsxs","File","jsx"],"mappings":";;;;;;;;;;;;;;AAAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;AAYO,IAAM,YAAe,GAAA,YAAA;AAEf,IAAA,QAAA,GAAW,YAAuB,CAAA,CAAC,OAAY,KAAA;AAC1D,EAAM,MAAA;AAAA,IACJ,MAAA,GAAS,EAAE,IAAA,EAAM,OAAQ,EAAA;AAAA,IACzB,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OAAA;AAAA,IACA,WAAW,EAAC;AAAA,IACZ,QAAW,GAAA,SAAA;AAAA,IACX,UAAa,GAAA,EAAA;AAAA,IACb,QAAW,GAAA,QAAA;AAAA,IACX,WAAc,GAAA,KAAA;AAAA,IACd,YAAe,GAAA,eAAA;AAAA,IACf,YAAA,EAAAA,gBAAe,EAAC;AAAA,IAChB,OAAU,GAAA,KAAA;AAAA,IACV,SAAS,EAAC;AAAA,GACR,GAAA,OAAA,CAAA;A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,IAAA,CAAK,IAAM,EAAA,IAAA,EAAM,KAAK,IAAM,EAAA,MAAA,EAAQ,QAAQ,MAAQ,EAAA,MAAA,EAAQ,QAAQ,MACvG,EAAA,QAAA,EAAA;AAAA,sBAAAC,GAAAA,CAACD,IAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,OAAO,CAAG,EAAA,IAAA,EAAK,WAAY,EAAA,UAAA,EAAU,IAAC,EAAA,CAAA;AAAA,sBAE1DC,IAAC,OAAQ,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-U3JPULJV.js","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, type ts } 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 } 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.output?.banner} footer={plugin.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: { output },\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, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport type { PluginTs } from './types.ts'\nimport { oasGenerator, typeGenerator } from './generators'\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 output: {\n exportType: 'barrelNamed',\n ...output,\n },\n options: {\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: { output, key: pluginKey },\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,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQMY4POF3_cjs = require('./chunk-QMY4POF3.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "OasType", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkQMY4POF3_cjs.OasType; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "Type", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkQMY4POF3_cjs.Type; }
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=components.cjs.map
|
|
16
16
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { OasTypes } from '@kubb/oas';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { Schema } from '@kubb/plugin-oas';
|
|
4
|
-
import { P as PluginTs } from './types-
|
|
4
|
+
import { P as PluginTs } from './types-DWIokV65.cjs';
|
|
5
5
|
import '@kubb/core';
|
|
6
|
-
import '@kubb/fs/types';
|
|
7
6
|
import '@kubb/parser-ts';
|
|
8
7
|
|
|
9
8
|
type Props$1 = {
|
package/dist/components.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { OasTypes } from '@kubb/oas';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { Schema } from '@kubb/plugin-oas';
|
|
4
|
-
import { P as PluginTs } from './types-
|
|
4
|
+
import { P as PluginTs } from './types-DWIokV65.js';
|
|
5
5
|
import '@kubb/core';
|
|
6
|
-
import '@kubb/fs/types';
|
|
7
6
|
import '@kubb/parser-ts';
|
|
8
7
|
|
|
9
8
|
type Props$1 = {
|
package/dist/components.js
CHANGED
package/dist/generators.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunk3EAINOIS_cjs = require('./chunk-3EAINOIS.cjs');
|
|
4
|
+
require('./chunk-QMY4POF3.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "oasGenerator", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk3EAINOIS_cjs.oasGenerator; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "typeGenerator", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk3EAINOIS_cjs.typeGenerator; }
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=generators.cjs.map
|
|
17
17
|
//# sourceMappingURL=generators.cjs.map
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as _kubb_plugin_oas from '@kubb/plugin-oas';
|
|
2
|
-
import { P as PluginTs } from './types-
|
|
2
|
+
import { P as PluginTs } from './types-DWIokV65.cjs';
|
|
3
3
|
import '@kubb/core';
|
|
4
|
-
import '@kubb/fs/types';
|
|
5
4
|
import '@kubb/parser-ts';
|
|
6
5
|
|
|
7
6
|
declare const typeGenerator: _kubb_plugin_oas.Generator<PluginTs>;
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as _kubb_plugin_oas from '@kubb/plugin-oas';
|
|
2
|
-
import { P as PluginTs } from './types-
|
|
2
|
+
import { P as PluginTs } from './types-DWIokV65.js';
|
|
3
3
|
import '@kubb/core';
|
|
4
|
-
import '@kubb/fs/types';
|
|
5
4
|
import '@kubb/parser-ts';
|
|
6
5
|
|
|
7
6
|
declare const typeGenerator: _kubb_plugin_oas.Generator<PluginTs>;
|
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { oasGenerator, typeGenerator } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { oasGenerator, typeGenerator } from './chunk-U3JPULJV.js';
|
|
2
|
+
import './chunk-QO5MHF5I.js';
|
|
3
3
|
//# sourceMappingURL=generators.js.map
|
|
4
4
|
//# sourceMappingURL=generators.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunk3EAINOIS_cjs = require('./chunk-3EAINOIS.cjs');
|
|
4
|
+
require('./chunk-QMY4POF3.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "pluginTs", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk3EAINOIS_cjs.pluginTs; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "pluginTsName", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk3EAINOIS_cjs.pluginTsName; }
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=index.cjs.map
|
|
17
17
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
import { PluginFactoryOptions, ResolveNameParams } from '@kubb/core';
|
|
2
|
-
import * as KubbFile from '@kubb/fs/types';
|
|
1
|
+
import { PluginFactoryOptions, Output, ResolveNameParams } from '@kubb/core';
|
|
3
2
|
import { ts } from '@kubb/parser-ts';
|
|
4
3
|
import { ResolvePathOptions, Exclude, Include, Override } from '@kubb/plugin-oas';
|
|
5
4
|
|
|
6
5
|
type Options = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* @default 'types'
|
|
12
|
-
*/
|
|
13
|
-
path: string;
|
|
14
|
-
/**
|
|
15
|
-
* Name to be used for the `export * as {{exportAs}} from './'`
|
|
16
|
-
*/
|
|
17
|
-
exportAs?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Add an extension to the generated imports and exports, default it will not use an extension
|
|
20
|
-
*/
|
|
21
|
-
extName?: KubbFile.Extname;
|
|
22
|
-
/**
|
|
23
|
-
* Define what needs to exported, here you can also disable the export of barrel files
|
|
24
|
-
* @default `'barrel'`
|
|
25
|
-
*/
|
|
26
|
-
exportType?: 'barrel' | 'barrelNamed' | false;
|
|
27
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* @default 'types'
|
|
8
|
+
*/
|
|
9
|
+
output?: Output;
|
|
28
10
|
/**
|
|
29
11
|
* Group the TypeScript types based on the provided name.
|
|
30
12
|
*/
|
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
import { PluginFactoryOptions, ResolveNameParams } from '@kubb/core';
|
|
2
|
-
import * as KubbFile from '@kubb/fs/types';
|
|
1
|
+
import { PluginFactoryOptions, Output, ResolveNameParams } from '@kubb/core';
|
|
3
2
|
import { ts } from '@kubb/parser-ts';
|
|
4
3
|
import { ResolvePathOptions, Exclude, Include, Override } from '@kubb/plugin-oas';
|
|
5
4
|
|
|
6
5
|
type Options = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* @default 'types'
|
|
12
|
-
*/
|
|
13
|
-
path: string;
|
|
14
|
-
/**
|
|
15
|
-
* Name to be used for the `export * as {{exportAs}} from './'`
|
|
16
|
-
*/
|
|
17
|
-
exportAs?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Add an extension to the generated imports and exports, default it will not use an extension
|
|
20
|
-
*/
|
|
21
|
-
extName?: KubbFile.Extname;
|
|
22
|
-
/**
|
|
23
|
-
* Define what needs to exported, here you can also disable the export of barrel files
|
|
24
|
-
* @default `'barrel'`
|
|
25
|
-
*/
|
|
26
|
-
exportType?: 'barrel' | 'barrelNamed' | false;
|
|
27
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* @default 'types'
|
|
8
|
+
*/
|
|
9
|
+
output?: Output;
|
|
28
10
|
/**
|
|
29
11
|
* Group the TypeScript types based on the provided name.
|
|
30
12
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-ts",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.19",
|
|
4
4
|
"description": "Generator plugin-ts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zod",
|
|
@@ -58,25 +58,23 @@
|
|
|
58
58
|
"!/**/__tests__/**"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@kubb/core": "3.0.0-alpha.
|
|
62
|
-
"@kubb/fs": "3.0.0-alpha.
|
|
63
|
-
"@kubb/oas": "3.0.0-alpha.
|
|
64
|
-
"@kubb/parser-ts": "3.0.0-alpha.
|
|
65
|
-
"@kubb/plugin-oas": "3.0.0-alpha.
|
|
66
|
-
"@kubb/react": "3.0.0-alpha.
|
|
61
|
+
"@kubb/core": "3.0.0-alpha.19",
|
|
62
|
+
"@kubb/fs": "3.0.0-alpha.19",
|
|
63
|
+
"@kubb/oas": "3.0.0-alpha.19",
|
|
64
|
+
"@kubb/parser-ts": "3.0.0-alpha.19",
|
|
65
|
+
"@kubb/plugin-oas": "3.0.0-alpha.19",
|
|
66
|
+
"@kubb/react": "3.0.0-alpha.19"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/react": "^18.3.5",
|
|
70
|
-
"prettier": "^3.3.3",
|
|
71
70
|
"react": "^18.3.1",
|
|
72
71
|
"tsup": "^8.2.4",
|
|
73
72
|
"typescript": "^5.6.2",
|
|
74
|
-
"@kubb/config-
|
|
75
|
-
"@kubb/config-
|
|
76
|
-
"@kubb/config-tsup": "3.0.0-alpha.17"
|
|
73
|
+
"@kubb/config-ts": "3.0.0-alpha.19",
|
|
74
|
+
"@kubb/config-tsup": "3.0.0-alpha.19"
|
|
77
75
|
},
|
|
78
76
|
"peerDependencies": {
|
|
79
|
-
"@kubb/react": "3.0.0-alpha.
|
|
77
|
+
"@kubb/react": "3.0.0-alpha.19"
|
|
80
78
|
},
|
|
81
79
|
"engines": {
|
|
82
80
|
"node": ">=20"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type bodyUploadFileApiAssetsPost = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @type string, binary
|
|
4
|
+
*/
|
|
5
|
+
file: Blob;
|
|
6
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export type cat = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @type string, uuid
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
type: "Cat";
|
|
7
|
+
/**
|
|
8
|
+
* @type boolean | undefined
|
|
9
|
+
*/
|
|
10
|
+
meow?: boolean;
|
|
11
|
+
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description Null response
|
|
3
|
-
|
|
4
|
-
export type CreatePets201 = error & {
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
*/
|
|
4
|
+
export type CreatePets201 = (error & {
|
|
5
|
+
name?: errorCode;
|
|
6
|
+
});
|
|
7
7
|
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
9
|
* @description unexpected error
|
|
10
|
-
|
|
11
|
-
export type CreatePetsError = error
|
|
10
|
+
*/
|
|
11
|
+
export type CreatePetsError = error;
|
|
12
12
|
|
|
13
|
-
export type CreatePetsMutationRequest = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
13
|
+
export type CreatePetsMutationRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* @type string
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* @type string
|
|
20
|
+
*/
|
|
21
|
+
tag: string;
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
25
|
* @description Null response
|
|
26
|
-
|
|
27
|
-
export type CreatePetsMutationResponse = error & {
|
|
28
|
-
|
|
29
|
-
}
|
|
26
|
+
*/
|
|
27
|
+
export type CreatePetsMutationResponse = (error & {
|
|
28
|
+
name?: errorCode;
|
|
29
|
+
});
|
|
30
30
|
|
|
31
|
-
export type createPetsMutation = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
31
|
+
export type createPetsMutation = {
|
|
32
|
+
Response: createPetsMutationResponse;
|
|
33
|
+
Request: createPetsMutationRequest;
|
|
34
|
+
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description Null response
|
|
3
|
-
|
|
4
|
-
export type CreatePets201 = error & {
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
*/
|
|
4
|
+
export type CreatePets201 = (error & {
|
|
5
|
+
name?: errorCode;
|
|
6
|
+
});
|
|
7
7
|
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
9
|
* @description unexpected error
|
|
10
|
-
|
|
11
|
-
export type CreatePetsError = error
|
|
10
|
+
*/
|
|
11
|
+
export type CreatePetsError = error;
|
|
12
12
|
|
|
13
|
-
export type CreatePetsMutationRequest = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
13
|
+
export type CreatePetsMutationRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* @type string
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* @type string
|
|
20
|
+
*/
|
|
21
|
+
tag: string;
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
25
|
* @description Null response
|
|
26
|
-
|
|
27
|
-
export type CreatePetsMutationResponse = error & {
|
|
28
|
-
|
|
29
|
-
}
|
|
26
|
+
*/
|
|
27
|
+
export type CreatePetsMutationResponse = (error & {
|
|
28
|
+
name?: errorCode;
|
|
29
|
+
});
|
|
30
30
|
|
|
31
|
-
export type createPetsMutation = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
31
|
+
export type createPetsMutation = {
|
|
32
|
+
Response: createPetsMutationResponse;
|
|
33
|
+
Request: createPetsMutationRequest;
|
|
34
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type DeletePetsPetidMutationResponse = any
|
|
1
|
+
export type DeletePetsPetidMutationResponse = any;
|
|
2
2
|
|
|
3
|
-
export type deletePetsPetidMutation = {
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
export type deletePetsPetidMutation = {
|
|
4
|
+
Response: deletePetsPetidMutationResponse;
|
|
5
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export type dog = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @type string, uuid
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* @type number | undefined
|
|
8
|
+
*/
|
|
9
|
+
bark?: number;
|
|
10
|
+
type: "Dog";
|
|
11
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const enumAllOfReasonEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
"created_at": "created_at",
|
|
3
|
+
"description": "description"
|
|
4
|
+
} as const;
|
|
5
5
|
|
|
6
|
-
export type EnumAllOfReasonEnum2 = (typeof enumAllOfReasonEnum2)[keyof typeof enumAllOfReasonEnum2]
|
|
6
|
+
export type EnumAllOfReasonEnum2 = (typeof enumAllOfReasonEnum2)[keyof typeof enumAllOfReasonEnum2];
|
|
7
7
|
|
|
8
|
-
export type enumAllOf = {
|
|
9
|
-
|
|
10
|
-
}
|
|
8
|
+
export type enumAllOf = {
|
|
9
|
+
reason?: EnumAllOfReasonEnum2;
|
|
10
|
+
};
|