@kubb/swagger-ts 2.0.0-beta.7 → 2.0.0-beta.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/components.cjs +2 -3
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +6 -4
- package/dist/components.d.ts +6 -4
- package/dist/components.js +2 -3
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +5 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -63
- package/dist/index.d.ts +65 -63
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/{infer.d.ts → oas.d.ts} +56 -56
- package/dist/{infer.js → oas.js} +1 -1
- package/package.json +11 -11
- package/src/components/Oas.tsx +2 -2
- package/src/{infer → oas}/index.ts +1 -1
- package/src/{infer/parse.ts → oas/infer.ts} +1 -1
- package/src/plugin.ts +0 -1
- package/src/types.ts +7 -5
- /package/dist/{infer.js.map → oas.js.map} +0 -0
- /package/src/{infer → oas}/mappers.ts +0 -0
- /package/src/{infer → oas}/model.ts +0 -0
- /package/src/{infer → oas}/requestParams.ts +0 -0
- /package/src/{infer → oas}/response.ts +0 -0
- /package/src/{infer → oas}/security.ts +0 -0
package/dist/components.d.cts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ResolvePathOptions, Exclude, Include, Override, AppMeta as AppMeta$1, OasBuilder, OasTypes } from '@kubb/swagger';
|
2
|
-
import { PluginFactoryOptions,
|
2
|
+
import { PluginFactoryOptions, KubbFile, ResolveNameParams } from '@kubb/core';
|
3
3
|
import { ReactNode } from 'react';
|
4
4
|
|
5
5
|
type Options = {
|
@@ -14,6 +14,10 @@ type Options = {
|
|
14
14
|
* Name to be used for the `export * as {{exportAs}} from './'`
|
15
15
|
*/
|
16
16
|
exportAs?: string;
|
17
|
+
/**
|
18
|
+
* Add an extension to the generated imports and exports, default it will not use an extension
|
19
|
+
*/
|
20
|
+
extName?: KubbFile.Extname;
|
17
21
|
};
|
18
22
|
/**
|
19
23
|
* Group the TypeScript types based on the provided name.
|
@@ -69,9 +73,7 @@ type Options = {
|
|
69
73
|
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
70
74
|
};
|
71
75
|
/**
|
72
|
-
* Export Oas object as Oas type with import type { Infer } from
|
73
|
-
* TODO add docs
|
74
|
-
* @beta
|
76
|
+
* Export an Oas object as Oas type with `import type { Infer } from '@kubb/swagger-ts/oas'`
|
75
77
|
*/
|
76
78
|
oasType?: boolean;
|
77
79
|
};
|
package/dist/components.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ResolvePathOptions, Exclude, Include, Override, AppMeta as AppMeta$1, OasBuilder, OasTypes } from '@kubb/swagger';
|
2
|
-
import { PluginFactoryOptions,
|
2
|
+
import { PluginFactoryOptions, KubbFile, ResolveNameParams } from '@kubb/core';
|
3
3
|
import { ReactNode } from 'react';
|
4
4
|
|
5
5
|
type Options = {
|
@@ -14,6 +14,10 @@ type Options = {
|
|
14
14
|
* Name to be used for the `export * as {{exportAs}} from './'`
|
15
15
|
*/
|
16
16
|
exportAs?: string;
|
17
|
+
/**
|
18
|
+
* Add an extension to the generated imports and exports, default it will not use an extension
|
19
|
+
*/
|
20
|
+
extName?: KubbFile.Extname;
|
17
21
|
};
|
18
22
|
/**
|
19
23
|
* Group the TypeScript types based on the provided name.
|
@@ -69,9 +73,7 @@ type Options = {
|
|
69
73
|
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
70
74
|
};
|
71
75
|
/**
|
72
|
-
* Export Oas object as Oas type with import type { Infer } from
|
73
|
-
* TODO add docs
|
74
|
-
* @beta
|
76
|
+
* Export an Oas object as Oas type with `import type { Infer } from '@kubb/swagger-ts/oas'`
|
75
77
|
*/
|
76
78
|
oasType?: boolean;
|
77
79
|
};
|
package/dist/components.js
CHANGED
@@ -3192,7 +3192,7 @@ function Template({
|
|
3192
3192
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
3193
3193
|
`export const ${name} = ${JSON.stringify(api, void 0, 2)} as const`,
|
3194
3194
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
3195
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Type, { name: typeName, export: true, children: `
|
3195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` })
|
3196
3196
|
] });
|
3197
3197
|
}
|
3198
3198
|
var defaultTemplates = { default: Template };
|
@@ -3215,7 +3215,7 @@ Oas.File = function({ name, typeName, templates = defaultTemplates }) {
|
|
3215
3215
|
path: file.path,
|
3216
3216
|
meta: file.meta,
|
3217
3217
|
children: [
|
3218
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Import, { name: ["
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Import, { name: ["Infer"], path: "@kubb/swagger-ts/oas", isTypeOnly: true }),
|
3219
3219
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Source, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Oas, { Template: Template2, name, typeName }) })
|
3220
3220
|
]
|
3221
3221
|
}
|
@@ -3487,7 +3487,6 @@ createPlugin((options) => {
|
|
3487
3487
|
await this.fileManager.addIndexes({
|
3488
3488
|
root,
|
3489
3489
|
output,
|
3490
|
-
extName: ".ts",
|
3491
3490
|
meta: { pluginKey: this.plugin.key },
|
3492
3491
|
options: {
|
3493
3492
|
isTypeOnly: true
|