From ddc5573a3b2d625bcfb66775907ba8e59dc7b15e Mon Sep 17 00:00:00 2001 From: Stijn Van Hulle Date: Mon, 30 Sep 2024 21:46:45 +0200 Subject: [PATCH] docs: more documentation for client and ts plugin --- docs/.vitepress/config.ts | 1 - docs/blog/v3.md | 3 + docs/changelog.md | 2 +- docs/comparison.md | 39 ---- docs/getting-started/configure.md | 40 +++- docs/package.json | 2 +- docs/plugins/core/barrelTypes.md | 10 + docs/plugins/core/exclude.md | 15 ++ docs/plugins/core/generators.md | 0 docs/plugins/core/group.md | 26 +++ docs/plugins/core/groupTypes.md | 1 + docs/plugins/core/include.md | 15 ++ docs/plugins/core/override.md | 15 ++ docs/plugins/core/transformers.md | 0 docs/plugins/plugin-client/index.md | 275 +++++++----------------- docs/plugins/plugin-oas/index.md | 36 +--- docs/plugins/plugin-redoc/index.md | 3 +- docs/plugins/plugin-ts/index.md | 299 ++++++++++----------------- examples/client/kubb.config.ts | 6 +- examples/react-query/package.json | 2 +- packages/cli/src/generate.ts | 6 +- packages/core/src/FileManager.ts | 3 +- packages/core/src/types.ts | 27 ++- packages/oas/package.json | 2 +- packages/plugin-client/src/plugin.ts | 1 - packages/plugin-client/src/types.ts | 9 +- packages/plugin-ts/src/plugin.ts | 15 +- packages/plugin-ts/src/types.ts | 23 +-- pnpm-lock.yaml | 183 ++++++++++++---- 29 files changed, 486 insertions(+), 573 deletions(-) delete mode 100644 docs/comparison.md create mode 100644 docs/plugins/core/barrelTypes.md create mode 100644 docs/plugins/core/exclude.md create mode 100644 docs/plugins/core/generators.md create mode 100644 docs/plugins/core/group.md create mode 100644 docs/plugins/core/groupTypes.md create mode 100644 docs/plugins/core/include.md create mode 100644 docs/plugins/core/override.md create mode 100644 docs/plugins/core/transformers.md diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index fe6e3fefa..ec885c530 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -5,7 +5,6 @@ import { groupIconMdPlugin, groupIconVitePlugin, localIconLoader } from 'vitepre import { transformerTwoslash } from '@shikijs/vitepress-twoslash' import { SitemapStream } from 'sitemap' import { defineConfig } from 'vitepress' -import { withMermaid } from "vitepress-plugin-mermaid"; import { renderMermaidGraphsPlugin } from './mermaid'; import { transposeTables } from "./transposeTables.ts" diff --git a/docs/blog/v3.md b/docs/blog/v3.md index 88a8f70dd..e57ee467d 100644 --- a/docs/blog/v3.md +++ b/docs/blog/v3.md @@ -71,6 +71,9 @@ output: { ``` - Refactor of grouping(use of name instead of output) and output based on `output` of the current plugin +[//]: # (- [`@kubb/plugin-ts`] Removal of `enumType` in favor of `enum.type`) + +[//]: # (- [`@kubb/plugin-ts`] Removal of `enumSuffix` in favor of `enum.suffix`) ## Thanks diff --git a/docs/changelog.md b/docs/changelog.md index 6ceaff6c1..1e81d5046 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -29,7 +29,7 @@ export default defineConfig({ output: { path: './clients/axios', }, - group: { type: 'tag', output: './clients/axios/{{tag}}Service' }, // [!code --] + // group: { type: 'tag', output: './clients/axios/{{tag}}Service' }, // [!code --] group: { type: 'tag', name: ({ group }) => `${group}Service` }, // [!code ++] }), ], diff --git a/docs/comparison.md b/docs/comparison.md deleted file mode 100644 index 3c4fc3e1c..000000000 --- a/docs/comparison.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: doc - -title: Comparison -outline: deep ---- - -# Comparison - -::: warning Under construction -::: - -Feature/Capability Key: - -- ✅ 1st-class, built-in, and ready to use with no added configuration or code -- 🟡 Supported, but as an unofficial 3rd party or community library/contribution -- 🛑 Not officially supported or documented. - -| | Kubb | Swagger-codegen [_(Website)_][swagger-codegen] | -| ------------------- | ---------------------------------------------------------- | ------------------------------------------------ | -| GitHub Repo / Stars | [![][stars-kubb]][gh-kubb] | [![][stars-swagger-codegen]][gh-swagger-codegen] | -| Bundle Size | [![][bp-kubb]][bpl-kubb] | [![][bp-swagger-codegen]][bpl-swagger-codegen] | -| Plugins/clients | typescript, tanstack-query, swr, zod, zodios, axios, faker | typescript-fetch, typescript-node | -| OpenAPI version | v2, v3, v3.1 | v2, v3, v3.1 | - - - -For more libraries visit [https://tools.openapis.org](https://tools.openapis.org/categories/code-generators.html). - -[bpl-kubb]: https://bundlephobia.com/result?p=@kubb/core -[bp-kubb]: https://badgen.net/bundlephobia/minzip/@kubb/core?label=💾 -[gh-kubb]: https://github.com/kubb-labs/kubb -[stars-kubb]: https://img.shields.io/github/stars/kubb-labs/kubb?label=%F0%9F%8C%9F -[swagger-codegen]: https://swagger.io/tools/swagger-codegen/ -[bp-swagger-codegen]: https://badgen.net/bundlephobia/minzip/swagger-codegen?label=💾 -[gh-swagger-codegen]: https://github.com/swagger-api/swagger-codegen -[stars-swagger-codegen]: https://img.shields.io/github/stars/swagger-api/swagger-codegen?label=%F0%9F%8C%9F -[bpl-swagger-codegen]: https://bundlephobia.com/result?p=swagger-codegen diff --git a/docs/getting-started/configure.md b/docs/getting-started/configure.md index babd71cfe..38cc5f591 100644 --- a/docs/getting-started/configure.md +++ b/docs/getting-started/configure.md @@ -242,14 +242,40 @@ export default defineConfig({ }) ``` -#### output.exportType +#### output.extension +Override the extension to the generated imports and exports, by default the plugin will add an extension. + +| | | +|----------:|:-------------------------| +| Type: | `Record` | +| Required: | `false` | +| Default: | `{ '.ts': '.ts'}` | + + +```typescript [kubb.config.ts] +import { defineConfig } from '@kubb/core' + +export default defineConfig({ + input: { + path: './petStore.yaml', + }, + output: { + path: './src/gen', + extension: { + '.ts': '.js', + }, + }, +}) +``` + +#### output.barrelType Define what needs to exported, here you can also disable the export of barrel files. -| | | -|----------:|:-------------------------------------| -| Type: | `'barrel' \| 'barrelNamed' \| false` | -| Required: | `false` | -| Default: | `'barrelNamed'` | +| | | +|----------:|:----------------------------| +| Type: | `'all' \| 'named' \| false` | +| Required: | `false` | +| Default: | `'named'` | ```typescript [kubb.config.ts] @@ -262,7 +288,7 @@ export default defineConfig({ output: { path: './src/gen', clean: true, - exportType: 'barrel', + barrelType: 'all', }, }) ``` diff --git a/docs/package.json b/docs/package.json index bcfd9cb7e..2e94c4428 100644 --- a/docs/package.json +++ b/docs/package.json @@ -44,9 +44,9 @@ "@kubb/plugin-vue-query": "workspace:*", "@kubb/plugin-zod": "workspace:*", "@kubb/react": "workspace:*", + "@mermaid-js/mermaid-cli": "^11.2.0", "@types/node": "^20.16.10", "@types/react": "^18.3.10", - "@mermaid-js/mermaid-cli": "^11.2.0", "cross-env": "^7.0.3", "react": "^18.3.1", "unplugin-kubb": "workspace:^", diff --git a/docs/plugins/core/barrelTypes.md b/docs/plugins/core/barrelTypes.md new file mode 100644 index 000000000..f1a96b22a --- /dev/null +++ b/docs/plugins/core/barrelTypes.md @@ -0,0 +1,10 @@ +::: code-group +```typescript [all] +export * from "./gen/petService.ts" +``` +```typescript [named] +export { PetService } from "./gen/petService.ts" +``` +```typescript [false] +``` +::: diff --git a/docs/plugins/core/exclude.md b/docs/plugins/core/exclude.md new file mode 100644 index 000000000..2e9d642ac --- /dev/null +++ b/docs/plugins/core/exclude.md @@ -0,0 +1,15 @@ +Array containing exclude parameters to exclude/skip tags/operations/methods/paths. + +| | | +|----------:|:-----------------| +| Type: | `Array` | +| Required: | `false` | + + +```typescript [Exclude] +export type Exclude = { + type: 'tag' | 'operationId' | 'path' | 'method' + pattern: string | RegExp +} +``` + diff --git a/docs/plugins/core/generators.md b/docs/plugins/core/generators.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/plugins/core/group.md b/docs/plugins/core/group.md new file mode 100644 index 000000000..aa962c8ad --- /dev/null +++ b/docs/plugins/core/group.md @@ -0,0 +1,26 @@ +Grouping makes it possible to combine files in a folder based on specific `type`. + +Imagine you have the following setup: + +```typescript +group: { + type: 'tag', + name({ group }){ + return `${group}Controller` + } +} +``` +That will create a structure like this: +``` +. +├── src/ +│ └── petController/ +│ │ ├── addPet.ts +│ │ └── getPet.ts +│ └── storeController/ +│ ├── createStore.ts +│ └── getStoreById.ts +├── petStore.yaml +├── kubb.config.ts +└── package.json +``` diff --git a/docs/plugins/core/groupTypes.md b/docs/plugins/core/groupTypes.md new file mode 100644 index 000000000..af05d40ff --- /dev/null +++ b/docs/plugins/core/groupTypes.md @@ -0,0 +1 @@ +- `'tag'`: Use of operation.getTags().at(0)?.name diff --git a/docs/plugins/core/include.md b/docs/plugins/core/include.md new file mode 100644 index 000000000..ae0200b09 --- /dev/null +++ b/docs/plugins/core/include.md @@ -0,0 +1,15 @@ +Array containing include parameters to include tags/operations/methods/paths. + +| | | +|----------:|:-----------------| +| Type: | `Array` | +| Required: | `false` | + +```typescript [Include] +export type Include = { + type: 'tag' | 'operationId' | 'path' | 'method' + pattern: string | RegExp +} +``` + + diff --git a/docs/plugins/core/override.md b/docs/plugins/core/override.md new file mode 100644 index 000000000..6d0ade6fe --- /dev/null +++ b/docs/plugins/core/override.md @@ -0,0 +1,15 @@ +Array containing override parameters to override `options` based on tags/operations/methods/paths. + +| | | +|----------:|:------------------| +| Type: | `Array` | +| Required: | `false` | + + +```typescript [Override] +export type Override = { + type: 'tag' | 'operationId' | 'path' | 'method' + pattern: string | RegExp + options: PluginOptions +} +``` diff --git a/docs/plugins/core/transformers.md b/docs/plugins/core/transformers.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/plugins/plugin-client/index.md b/docs/plugins/plugin-client/index.md index d43d518d8..b2612f8a8 100644 --- a/docs/plugins/plugin-client/index.md +++ b/docs/plugins/plugin-client/index.md @@ -7,7 +7,7 @@ outline: deep # @kubb/plugin-client -With the Client plugin you can generate [Axios](https://axios-http.com/docs/intro) API controllers. +The Client plugin enables you to generate [Axios](https://axios-http.com/docs/intro) API controllers, simplifying the process of handling API requests and improving integration between frontend and backend services. ## Installation @@ -32,10 +32,14 @@ yarn add @kubb/plugin-client ## Options ### output +Specify the export location for the files and define the behavior of the output. #### output.path -Output to save the generated files. +Path to the output folder or file that will contain the generated code. + +> [!TIP] +> if `output.path` is a file, `group` cannot be used. | | | |----------:|:------------| @@ -43,76 +47,17 @@ Output to save the generated files. | Required: | `true` | | Default: | `'clients'` | -```typescript -import { pluginClient } from '@kubb/plugin-client' - -const plugin = pluginClient({ - output: { - path: './axios', - }, -}) -``` - -#### output.exportAs - -Name to be used for the `export * as {{exportAs}} from './'`. - -| | | -|----------:|:---------------| -| Type: | `string` | -| Required: | `false` | - -```typescript -import { pluginClient } from '@kubb/plugin-client' - -const plugin = pluginClient({ - output: { - path: './axios', - exportAs: 'clients', - }, -}) -``` - -#### output.extName - -Add an extension to the generated imports and exports, default it will not use an extension. - -| | | -|----------:|:-------------------| -| Type: | `KubbFile.Extname` | -| Required: | `false` | - -```typescript -import { pluginClient } from '@kubb/plugin-client' - -const plugin = pluginClient({ - output: { - path: './axios', - extName: '.js', - }, -}) -``` - -#### output.exportType - -Define what needs to exported, here you can also disable the export of barrel files. +#### output.barrelType -| | | -|----------:|:--------------------------------------| -| Type: | `'barrel' \| 'barrelNamed' \| false ` | -| Required: | `false` | -| Default: | `'barrelNamed'` | +Define what needs to be exported, here you can also disable the export of barrel files. -```typescript -import { pluginClient } from '@kubb/plugin-client' +| | | +|----------:|:----------------------------| +| Type: | `'all' \| 'named' \| false` | +| Required: | `false` | +| Default: | `'named'` | -const plugin = pluginClient({ - output: { - path: './client', - exportType: 'barrel', - }, -}) -``` + #### output.banner Add a banner text in the beginning of every file. @@ -122,17 +67,6 @@ Add a banner text in the beginning of every file. | Type: | `string` | | Required: | `false` | -```typescript -import { pluginClient } from '@kubb/plugin-client' - -const plugin = pluginClient({ - output: { - path: './client', - banner: '/* eslint-disable no-alert, no-console */' - }, -}) -``` - #### output.footer Add a footer text in the beginning of every file. @@ -146,69 +80,46 @@ import { pluginClient } from '@kubb/plugin-client' const plugin = pluginClient({ output: { - path: './client', + path: './axios', + barrelType: 'named', + banner: '/* eslint-disable no-alert, no-console */', footer: '' }, }) ``` ### group - -Group the clients based on the provided name. + #### group.type - -Tag will group based on the operation tag inside the Swagger file. +Define a type where to group the files on. | | | |----------:|:--------| | Type: | `'tag'` | | Required: | `true` | -#### group.output -> [!TIP] -> When defining a custom output path, you should also update `output.path` to contain the same root path. - - -::: v-pre -Relative path to save the grouped clients. -`{{tag}}` will be replaced by the current tagName. -::: - -::: v-pre - -| | | -|----------:|:------------------------------| -| Type: | `string` | -| Required: | `false` | -| Default: | `'${output}/{{tag}}Controller'` | + -::: +#### group.name -#### group.exportAs +Return the name of a group based on the group name, this will be used for the file and name generation. -::: v-pre -Name to be used for the `export * as {{exportAs}} from './` -::: +| | | +|----------:|:------------------------------------| +| Type: | `(context: GroupContext) => string` | +| Required: | `false` | +| Default: | `(ctx) => '${ctx.group}Controller'` | -::: v-pre - -| | | -|----------:|:-------------------| -| Type: | `string` | -| Required: | `false` | -| Default: | `'{{tag}}Service'` | - -::: ```typescript import { pluginClient } from '@kubb/plugin-client' const plugin = pluginClient({ - output: { - path: './clients/axios' + group: { + type: 'tag', + name: (ctx) => `${ctx.group}Controller` }, - group: { type: 'tag', output: './clients/axios/{{tag}}Service' }, }) ``` @@ -216,8 +127,10 @@ const plugin = pluginClient({ Path to the client import path that will be used to do the API calls.
It will be used as `import client from '${client.importPath}'`.
-It allow both relative and absolute path. the path will be applied as is, -so relative path should be based on the file being generated. +It allows both relative and absolute path but be aware that we will not change the path. + +> [!TIP] +> Use of default exports as `export default client = ()=>{}` | | | |----------:|:-------------------------------| @@ -237,7 +150,6 @@ const plugin = pluginClient({ ``` ### operations - Create `operations.ts` file with all operations grouped by methods. | | | @@ -257,13 +169,19 @@ const plugin = pluginClient({ ### dataReturnType -ReturnType that needs to be used when calling client(). +ReturnType that will be used when calling the client. -`'data'` will return ResponseConfig[data].
-`'full'` will return ResponseConfig. +| | | +|----------:|:-------------------| +| Type: | `'data' \| 'full'` | +| Required: | `false` | +| Default: | `'data'` | -::: code-group +- `'data'` will return ResponseConfig[data].
+- `'full'` will return ResponseConfig. + +::: code-group ```typescript ['data'] export async function getPetById( petId: GetPetByIdPathParams, @@ -279,16 +197,8 @@ export async function getPetById( ... } ``` - ::: -| | | -|----------:|:-------------------| -| Type: | `'data' \| 'full'` | -| Required: | `false` | -| Default: | `'data'` | - - ```typescript import { pluginClient } from '@kubb/plugin-client' @@ -301,11 +211,17 @@ const plugin = pluginClient({ How to pass your pathParams. -`'object'` will return the pathParams as an object.
-`'inline'` will return the pathParams as comma separated params. +| | | +|----------:|:-----------------------| +| Type: | `'object' \| 'inline'` | +| Required: | `false` | +| Default: | `'data'` | + -::: code-group +- `'object'` will return the pathParams as an object.
+- `'inline'` will return the pathParams as comma separated params. +::: code-group ```typescript ['object'] export async function getPetById( { petId }: GetPetByIdPathParams, @@ -321,17 +237,8 @@ export async function getPetById( ... } ``` - ::: - -| | | -|----------:|:-----------------------| -| Type: | `'object' \| 'inline'` | -| Required: | `false` | -| Default: | `'data'` | - - ```typescript import { pluginClient } from '@kubb/plugin-client' @@ -342,7 +249,6 @@ const plugin = pluginClient({ ### parser Which parser can be used before returning the data. -`'zod'` will use `@kubb/plugin-zod` to parse the data. | | | |----------:|:--------------------| @@ -350,6 +256,7 @@ Which parser can be used before returning the data. | Required: | `false` | | Default: | `'client'` | +- `'zod'` will use `@kubb/plugin-zod` to parse the data. ```typescript import { pluginClient } from '@kubb/plugin-client' @@ -360,22 +267,7 @@ const plugin = pluginClient({ ``` ### include - -Array containing include parameters to include tags/operations/methods/paths. - -```typescript [Include] -export type Include = { - type: 'tag' | 'operationId' | 'path' | 'method' - pattern: string | RegExp -} -``` - - -| | | -|----------:|:-----------------| -| Type: | `Array` | -| Required: | `false` | - + ```typescript import { pluginClient } from '@kubb/plugin-client' @@ -391,21 +283,7 @@ const plugin = pluginClient({ ``` ### exclude - -Array containing exclude parameters to exclude/skip tags/operations/methods/paths. - -```typescript [Exclude] -export type Exclude = { - type: 'tag' | 'operationId' | 'path' | 'method' - pattern: string | RegExp -} -``` - -| | | -|----------:|:-----------------| -| Type: | `Array` | -| Required: | `false` | - + ```typescript import { pluginClient } from '@kubb/plugin-client' @@ -421,23 +299,7 @@ const plugin = pluginClient({ ``` ### override - -Array containing override parameters to override `options` based on tags/operations/methods/paths. - - -```typescript [Override] -export type Override = { - type: 'tag' | 'operationId' | 'path' | 'method' - pattern: string | RegExp - options: PluginOptions -} -``` - -| | | -|----------:|:------------------| -| Type: | `Array` | -| Required: | `false` | - + ```typescript import { pluginClient } from '@kubb/plugin-client' @@ -455,17 +317,30 @@ const plugin = pluginClient({ }) ``` +### generators + + +| | | +|----------:|:-----------------------------------------------------------------------------| +| Type: | `Array>` | +| Required: | `false` | + + ### transformers + #### transformers.name Customize the names based on the type that is provided by the plugin. +| | | +|----------:|:------------------------------------------------------------------------------| +| Type: | `(name: string, type?: ResolveType) => string` | +| Required: | `false` | -| | | -|----------:|:--------------------------------------------------------------------| -| Type: | `(name: string, type?: "function" \| "type" \| "file" ) => string` | -| Required: | `false` | +```typescript +type ResolveType = 'file' | 'function' | 'type' | 'const' +``` ```typescript import { pluginClient } from '@kubb/plugin-client' @@ -503,7 +378,7 @@ export default defineConfig({ }, group: { type: 'tag', - output: './clients/axios/{{tag}}Service', + name: ({ group }) => `${group}Service`, }, exclude: [ { diff --git a/docs/plugins/plugin-oas/index.md b/docs/plugins/plugin-oas/index.md index f2e797aa7..62223e943 100644 --- a/docs/plugins/plugin-oas/index.md +++ b/docs/plugins/plugin-oas/index.md @@ -168,11 +168,7 @@ const plugin = pluginOas({ ::: ### generators -Define some generators to create files based on the operation and/or schema. See `createGenerator`. - -All plugin are using generators to create files based on the OperationGenerator and SchemaGenerators. - -An empty array will result in no schema's being generated, in v2 of Kubb we used `output: false`. +Define some generators to create files based on the operation and/or schema. See `createGenerator`. All plugin are using generators to create files based on the OperationGenerator and SchemaGenerators. An empty array will result in no schema's being generated, in v2 of Kubb we used `output: false`. ::: info @@ -193,36 +189,6 @@ const plugin = pluginOas({ ``` ::: -### experimentalFilter - -::: info - -```typescript -import { pluginOas } from '@kubb/plugin-oas' - -const plugin = pluginOas({ - experimentalFilter: { - methods: ['get'], - }, -}) -``` -::: - -### experimentalSort - -::: info - -```typescript -import { pluginOas } from '@kubb/plugin-oas' - -const plugin = pluginOas({ - experimentalSort: { - properties: ['description', 'default', 'type'] - }, -}) -``` -::: - ## Example ```typescript diff --git a/docs/plugins/plugin-redoc/index.md b/docs/plugins/plugin-redoc/index.md index aec6635c0..814290315 100644 --- a/docs/plugins/plugin-redoc/index.md +++ b/docs/plugins/plugin-redoc/index.md @@ -35,7 +35,8 @@ yarn add @kubb/plugin-redoc ### output #### output.path -Output for the generated doc, [https://redocly.com/](https://redocly.com/) is being used for the generation. +Output for the generated doc. +For the generation we are using [https://redocly.com/](https://redocly.com/). | | | |----------:|:---------------| diff --git a/docs/plugins/plugin-ts/index.md b/docs/plugins/plugin-ts/index.md index 5ed6933ab..7542a9639 100644 --- a/docs/plugins/plugin-ts/index.md +++ b/docs/plugins/plugin-ts/index.md @@ -7,10 +7,9 @@ outline: deep # @kubb/plugin-ts -With the TypeScript plugin you can create [TypeScript](https://www.typescriptlang.org/) types based on a Swagger file. +With the TypeScript plugin you can create [TypeScript](https://www.typescriptlang.org/) types. ## Installation - ::: code-group ```shell [bun] @@ -28,77 +27,53 @@ npm install @kubb/plugin-ts ```shell [yarn] yarn add @kubb/plugin-ts ``` - ::: ## Options ### output +Specify the export location for the files and define the behavior of the output. #### output.path -Relative path to save the TypeScript types.
-When output is a file it will save all models inside that file else it will create a file per schema item. +Path to the output folder or file that will contain the generated code. -::: info -Type: `string`
-Default: `'types'` +> [!TIP] +> if `output.path` is a file, `group` cannot be used. -```typescript -import { pluginTs } from '@kubb/plugin-ts' +| | | +|----------:|:----------| +| Type: | `string` | +| Required: | `true` | +| Default: | `'types'` | -const plugin = pluginTs({ - output: { - path: './models', - }, -}) -``` -::: - -#### output.exportAs +#### output.barrelType -Name to be used for the `export * as {{exportAs}} from './'` +Define what needs to be exported, here you can also disable the export of barrel files. -::: info -Type: `string`
+| | | +|----------:|:----------------------------| +| Type: | `'all' \| 'named' \| false` | +| Required: | `false` | +| Default: | `'named'` | -```typescript -import { pluginTs } from '@kubb/plugin-ts' + -const plugin = pluginTs({ - output: { - path: './models', - exportAs: 'models', - }, -}) -``` -::: +#### output.banner +Add a banner text in the beginning of every file. -#### output.extName +| | | +|----------:|:--------------------------------------| +| Type: | `string` | +| Required: | `false` | -Add an extension to the generated imports and exports, default it will not use an extension +#### output.footer +Add a footer text in the beginning of every file. -::: info -Type: `string`
- -```typescript -import { pluginTs } from '@kubb/plugin-ts' - -const plugin = pluginTs({ - output: { - path: './models', - extName: '.js', - }, -}) -``` -::: - -#### output.exportType - -Define what needs to exported, here you can also disable the export of barrel files - -::: info -Type: `'barrel' | 'barrelNamed' | false`
+| | | +|----------:|:--------------------------------------| +| Type: | `string` | +| Required: | `false` | ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -106,60 +81,61 @@ import { pluginTs } from '@kubb/plugin-ts' const plugin = pluginTs({ output: { path: './types', - exportType: 'barrel', + barrelType: 'named', + banner: '/* eslint-disable no-alert, no-console */', + footer: '' }, }) ``` -::: - ### group - -Group the TypeScript types based on the provided name. + #### group.type +Define a type where to group the files on. -Tag will group based on the operation tag inside the Swagger file. +| | | +|----------:|:--------| +| Type: | `'tag'` | +| Required: | `true` | -Type: `'tag'`
-Required: `true` + -#### group.output -> [!TIP] -> When defining a custom output path, you should also update `output.path` to contain the same root path. +#### group.name -::: v-pre -Relative path to save the grouped TypeScript Types. -`{{tag}}` will be replaced by the current tagName. -::: +Return the name of a group based on the group name, this will be used for the file and name generation. -::: v-pre -Type: `string`
-Example: `models/{{tag}}Controller` => `models/PetController`
-Default: `'${output}/{{tag}}Controller'` -::: +| | | +|----------:|:------------------------------------| +| Type: | `(context: GroupContext) => string` | +| Required: | `false` | +| Default: | `(ctx) => '${ctx.group}Controller'` | -::: info ```typescript import { pluginTs } from '@kubb/plugin-ts' const plugin = pluginTs({ - output: { - path: './types' + group: { + type: 'tag', + name: (ctx) => `${ctx.group}Controller` }, - group: { type: 'tag', output: './types/{{tag}}Controller' }, }) ``` -::: ### enumType -Choose to use `enum` or `as const` for enums.
-`asConst` will use camelCase for the naming.
-`asPascalConst` will use PascalCase for the naming. +Choose to use `enum` or `as const` for enums. + +| | | +|----------:|:---------------------------------------------------------------------| +| Type: | `'enum' \| 'asConst' \| 'asPascalConst' \| 'constEnum' \| 'literal'` | +| Required: | `false` | +| Default: | `'asConst'` | -::: info TYPE + +- `asConst` will use camelCase for the naming. +- `asPascalConst` will use PascalCase for the naming. ::: code-group @@ -194,14 +170,8 @@ const enum PetType { ```typescript ['literal'] type PetType = 'dog' | 'cat' ``` - ::: -::: info - -Type: `'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'`
-Default: `'asConst'` - ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -209,18 +179,16 @@ const plugin = pluginTs({ enumType: 'enum', }) ``` -::: ### enumSuffix - Set a suffix for the generated enums. -::: info TYPE +| | | +|----------:|:------------------------------------| +| Type: | `string` | +| Required: | `false` | +| Default: | `''` | -::: info - -Type: `string`
-Default: `''` ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -229,13 +197,15 @@ const plugin = pluginTs({ enumSuffix: 'Enum', }) ``` -::: ### dateType - Choose to use `date` or `datetime` as JavaScript `Date` instead of `string`. -::: info TYPE +| | | +|----------:|:---------------------| +| Type: | `'string' \| 'date'` | +| Required: | `false` | +| Default: | `'string'` | ::: code-group @@ -250,13 +220,8 @@ type Pet = { date: Date } ``` - ::: -::: info - -Type: `'string' | 'date'`
-Default: `'string'` ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -265,13 +230,16 @@ const plugin = pluginTs({ dateType: 'string', }) ``` -::: ### unknownType Which type to use when the Swagger/OpenAPI file is not providing more information. -::: info TYPE +| | | +|----------:|:---------------------| +| Type: | `'any' \| 'unknown'` | +| Required: | `false` | +| Default: | `'any'` | ::: code-group @@ -287,12 +255,6 @@ type Pet = { } ``` -::: - -::: info -Type: `'any' | 'unknown'`
-Default: `'any'` - ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -300,16 +262,17 @@ const plugin = pluginTs({ unknownType: 'any', }) ``` -::: ### optionalType +Choose what to use as mode for an optional value. -Choose what to use as mode for an optional value.
- -::: info TYPE +| | | +|----------:|:----------------------------------------------------------------| +| Type: | `'questionToken' \| 'undefined' \| 'questionTokenAndUndefined'` | +| Required: | `false` | +| Default: | `'questionToken'` | ::: code-group - ```typescript ['questionToken'] type Pet = { type?: string @@ -329,11 +292,6 @@ type Pet = { ``` ::: -::: info - -Type: `'questionToken' | 'undefined' | 'questionTokenAndUndefined'`
-Default: `'questionToken'` - ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -341,15 +299,17 @@ const plugin = pluginTs({ optionalType: 'questionToken', }) ``` -::: ### oasType Export an Oas object as Oas type with `import type { Infer } from '@kubb/plugin-ts/oas'`
-See [infer](/plugins/plugin-ts/infer) in how to use the types with `@kubb/plugin-ts/oas`.
+See [infer](/helpers/oas) in how to use the types with `@kubb/plugin-ts/oas`.
+ +| | | +|----------:|:-------------------| +| Type: | `'infer' \| false` | +| Required: | `false` | -::: info -Type: `'infer' | false`
```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -358,27 +318,10 @@ const plugin = pluginTs({ oasType: 'infer', }) ``` -::: ### include - -Array containing include parameters to include tags/operations/methods/paths. - -::: info TYPE - -```typescript [Include] -export type Include = { - type: 'tag' | 'operationId' | 'path' | 'method' - pattern: string | RegExp -} -``` - -::: - -::: info - -Type: `Array`
+ ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -392,26 +335,9 @@ const plugin = pluginTs({ ], }) ``` -::: ### exclude - -Array containing exclude parameters to exclude/skip tags/operations/methods/paths. - -::: info TYPE - -```typescript [Exclude] -export type Exclude = { - type: 'tag' | 'operationId' | 'path' | 'method' - pattern: string | RegExp -} -``` - -::: - -::: info - -Type: `Array`
+ ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -425,27 +351,9 @@ const plugin = pluginTs({ ], }) ``` -::: ### override - -Array containing override parameters to override `options` based on tags/operations/methods/paths. - -::: info TYPE - -```typescript [Override] -export type Override = { - type: 'tag' | 'operationId' | 'path' | 'method' - pattern: string | RegExp - options: PluginOptions -} -``` - -::: - -::: info - -Type: `Array`
+ ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -456,23 +364,37 @@ const plugin = pluginTs({ type: 'tag', pattern: 'pet', options: { - enumType: "asConst" + dataReturnType: "full" }, }, ], }) ``` -::: + +### generators + + +| | | +|----------:|:-----------------------------| +| Type: | `Array>` | +| Required: | `false` | + ### transformers + #### transformers.name +Customize the names based on the type that is provided by the plugin. -Override the name of the TypeScript type that is getting generated, this will also override the name of the file. +| | | +|----------:|:------------------------------------------------------------------------------| +| Type: | `(name: string, type?: ResolveType) => string` | +| Required: | `false` | -::: info -Type: `(name: string, type?: "function" | "type" | "file" ) => string`
+```typescript +type ResolveType = 'file' | 'function' | 'type' | 'const' +``` ```typescript import { pluginTs } from '@kubb/plugin-ts' @@ -485,7 +407,6 @@ const plugin = pluginTs({ }, }) ``` -::: ## Example @@ -515,7 +436,7 @@ export default defineConfig({ ], group: { type: 'tag', - output: './types/{{tag}}Controller' + name: ({ group }) => `'${group}Controller` }, enumType: "asConst", enumSuffix: 'Enum', diff --git a/examples/client/kubb.config.ts b/examples/client/kubb.config.ts index 8c9ebc307..28b2aee14 100644 --- a/examples/client/kubb.config.ts +++ b/examples/client/kubb.config.ts @@ -19,10 +19,8 @@ export default defineConfig(() => { output: { path: './src/gen', clean: true, - extension() { - return { - '.ts': '.js', - } + extension: { + '.ts': '.js', }, }, plugins: [ diff --git a/examples/react-query/package.json b/examples/react-query/package.json index 6850a9d41..c39fa3cac 100644 --- a/examples/react-query/package.json +++ b/examples/react-query/package.json @@ -39,7 +39,7 @@ "devDependencies": { "@types/react": "^18.3.10", "@types/react-dom": "^18.3.0", - "@vitejs/plugin-react": "^4.3.1", + "@vitejs/plugin-react": "^4.3.2", "msw": "^1.3.4", "tsup": "^8.3.0", "typescript": "^5.6.2", diff --git a/packages/cli/src/generate.ts b/packages/cli/src/generate.ts index 31e31fa4f..15d2865a1 100644 --- a/packages/cli/src/generate.ts +++ b/packages/cli/src/generate.ts @@ -74,10 +74,8 @@ export async function generate({ input, config, args }: GenerateProps): Promise< output: { write: true, barrelType: 'named', - extension() { - return { - '.ts': '.ts', - } + extension: { + '.ts': '.ts', }, ...userConfig.output, }, diff --git a/packages/core/src/FileManager.ts b/packages/core/src/FileManager.ts index ee3bd3cee..20de115e0 100644 --- a/packages/core/src/FileManager.ts +++ b/packages/core/src/FileManager.ts @@ -397,8 +397,7 @@ export async function processFiles({ dryRun, config, logger, files }: WriteFiles const promises = orderedFiles.map(async (file) => { await queue.add(async () => { const message = file ? `Writing ${relative(config.root, file.path)}` : '' - const extnames = config.output.extension?.({}) - const extname = extnames?.[file.extname] + const extname = config.output.extension?.[file.extname] const source = await getSource(file, { logger, extname }) diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index f9095e60f..6cf3c1208 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -43,9 +43,6 @@ export type InputData = { type Input = InputPath | InputData -type OutContext = {} -type OutExtension = (context: OutContext) => Record - export type BarrelType = 'all' | 'named' /** @@ -81,10 +78,10 @@ export type Config = { write?: boolean /** - * Override the extension to the generated imports and exports, default the plugin will add an extension - * @default `() => ({ '.ts': '.ts'})` + * Override the extension to the generated imports and exports, by default the plugin will add an extension + * @default `{ '.ts': '.ts'}` */ - extension?: OutExtension + extension?: Record /** * Define what needs to exported, here you can also disable the export of barrel files. * @default `'named'` @@ -268,8 +265,9 @@ export type ResolveNameParams = { pluginKey?: Plugin['key'] /** * `file` will be used to customize the name of the created file(use of camelCase) - * `function` can be used used to customize the exported functions(use of camelCase) + * `function` can be used to customize the exported functions(use of camelCase) * `type` is a special type for TypeScript(use of PascalCase) + * `const` can be used for variables(use of camelCase) */ type?: 'file' | 'function' | 'type' | 'const' } @@ -291,14 +289,16 @@ export type PluginContext } - +/** + * Specify the export location for the files and define the behavior of the output + */ export type Output = { /** - * Output to save the generated files. + * Path to the output folder or file that will contain the generated code */ path: string /** - * Define what needs to exported, here you can also disable the export of barrel files. + * Define what needs to be exported, here you can also disable the export of barrel files * @default `'named'` */ barrelType?: BarrelType | false @@ -318,14 +318,11 @@ type GroupContext = { export type Group = { /** - * Tag will group based on the operation tag inside the Swagger file + * Define a type where to group the files on */ type: 'tag' /** - * Relative path to save the grouped clients. - * - * @example `${output}/{{tag}}Controller` => `clients/PetController` - * @default `({ group }) => `${group}Controller`` + * Return the name of a group based on the group name, this will be used for the file and name generation */ name?: (context: GroupContext) => string } diff --git a/packages/oas/package.json b/packages/oas/package.json index da8306049..df09b4100 100644 --- a/packages/oas/package.json +++ b/packages/oas/package.json @@ -67,7 +67,7 @@ "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false" }, "dependencies": { - "@redocly/openapi-core": "^1.25.3", + "@redocly/openapi-core": "^1.25.4", "hotscript": "^1.0.13", "json-schema-to-ts": "^3.1.1", "jsonpointer": "^5.0.1", diff --git a/packages/plugin-client/src/plugin.ts b/packages/plugin-client/src/plugin.ts index a29404a74..bc495624f 100644 --- a/packages/plugin-client/src/plugin.ts +++ b/packages/plugin-client/src/plugin.ts @@ -2,7 +2,6 @@ import path from 'node:path' import { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core' import { camelCase } from '@kubb/core/transformers' -import { renderTemplate } from '@kubb/core/utils' import { OperationGenerator, pluginOasName } from '@kubb/plugin-oas' import type { Plugin } from '@kubb/core' diff --git a/packages/plugin-client/src/types.ts b/packages/plugin-client/src/types.ts index 52c556f92..be35db3bb 100644 --- a/packages/plugin-client/src/types.ts +++ b/packages/plugin-client/src/types.ts @@ -3,6 +3,10 @@ import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@ku import type { Exclude, Generator, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas' export type Options = { + /** + * Specify the export location for the files and define the behavior of the output + * @default { path: 'clients', barrelType: 'named' } + */ output?: Output /** * Group the clients based on the provided name. @@ -28,13 +32,12 @@ export type Options = { /** * Path to the client import path that will be used to do the API calls. * It will be used as `import client from '${client.importPath}'`. - * It allows both relative and absolute path. - * the path will be applied as is, so relative path should be based on the file being generated. + * It allows both relative and absolute path but be aware that we will not change the path. * @default '@kubb/plugin-client/client' */ importPath?: string /** - * ReturnType that needs to be used when calling client(). + * ReturnType that will be used when calling the client. * * `Data` will return ResponseConfig[data]. * diff --git a/packages/plugin-ts/src/plugin.ts b/packages/plugin-ts/src/plugin.ts index cdd969b95..09148177c 100644 --- a/packages/plugin-ts/src/plugin.ts +++ b/packages/plugin-ts/src/plugin.ts @@ -1,6 +1,6 @@ import path from 'node:path' -import { FileManager, PluginManager, createPlugin } from '@kubb/core' +import { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core' import { camelCase, pascalCase } from '@kubb/core/transformers' import { renderTemplate } from '@kubb/core/utils' import { OperationGenerator, SchemaGenerator, pluginOasName } from '@kubb/plugin-oas' @@ -29,7 +29,6 @@ export const pluginTs = createPlugin((options) => { mapper = {}, generators = [typeGenerator, oasType === 'infer' ? oasGenerator : undefined].filter(Boolean), } = options - const template = group?.output ? group.output : `${output.path}/{{tag}}Controller` return { name: pluginTsName, @@ -52,6 +51,12 @@ export const pluginTs = createPlugin((options) => { const root = path.resolve(this.config.root, this.config.output.path) const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path)) + if (options?.tag && group?.type === 'tag') { + const groupName: Group['name'] = group?.name ? group.name : (ctx) => `${ctx.group}Controller` + + return path.resolve(root, output.path, groupName({ group: camelCase(options.tag) }), baseName) + } + if (mode === 'single') { /** * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend @@ -60,12 +65,6 @@ export const pluginTs = createPlugin((options) => { return path.resolve(root, output.path) } - if (options?.tag && group?.type === 'tag') { - const tag = camelCase(options.tag) - - return path.resolve(root, renderTemplate(template, { tag }), baseName) - } - return path.resolve(root, output.path, baseName) }, resolveName(name, type) { diff --git a/packages/plugin-ts/src/types.ts b/packages/plugin-ts/src/types.ts index 86d22f595..91aa8a49b 100644 --- a/packages/plugin-ts/src/types.ts +++ b/packages/plugin-ts/src/types.ts @@ -1,29 +1,17 @@ -import type { Output, PluginFactoryOptions, ResolveNameParams } from '@kubb/core' +import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@kubb/core' import type { Exclude, Generator, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas' import type ts from 'typescript' export type Options = { /** - * @default 'types' + * Specify the export location for the files and define the behavior of the output + * @default { path: 'types', barrelType: 'named' } */ output?: Output /** - * Group the TypeScript types based on the provided name. + * Group the clients based on the provided name. */ - group?: { - /** - * Tag will group based on the operation tag inside the Swagger file. - */ - type: 'tag' - /** - * Relative path to save the grouped TypeScript Types. - * - * `{{tag}}` will be replaced by the current tagName. - * @example `${output}/{{tag}}Controller` => `models/PetController` - * @default `${output}/{{tag}}Controller` - */ - output?: string - } + group?: Group /** * Array containing exclude parameters to exclude/skip tags/operations/methods/paths. */ @@ -48,7 +36,6 @@ export type Options = { * Default will be `'enum'` in version 3 of Kubb */ enumSuffix?: string - /** * Choose to use `date` or `datetime` as JavaScript `Date` instead of `string`. * @default 'string' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 001d8274a..9ff733a35 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -541,8 +541,8 @@ importers: specifier: ^18.3.0 version: 18.3.0 '@vitejs/plugin-react': - specifier: ^4.3.1 - version: 4.3.1(vite@4.5.5(@types/node@20.16.10)(terser@5.31.1)) + specifier: ^4.3.2 + version: 4.3.2(vite@4.5.5(@types/node@20.16.10)(terser@5.31.1)) msw: specifier: ^1.3.4 version: 1.3.4(typescript@5.6.2) @@ -1045,8 +1045,8 @@ importers: packages/oas: dependencies: '@redocly/openapi-core': - specifier: ^1.25.3 - version: 1.25.3 + specifier: ^1.25.4 + version: 1.25.4 hotscript: specifier: ^1.0.13 version: 1.0.13 @@ -1830,18 +1830,34 @@ packages: resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} engines: {node: '>=6.9.0'} + '@babel/compat-data@7.25.4': + resolution: {integrity: sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==} + engines: {node: '>=6.9.0'} + '@babel/core@7.24.7': resolution: {integrity: sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==} engines: {node: '>=6.9.0'} + '@babel/core@7.25.2': + resolution: {integrity: sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==} + engines: {node: '>=6.9.0'} + '@babel/generator@7.24.7': resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} engines: {node: '>=6.9.0'} + '@babel/generator@7.25.6': + resolution: {integrity: sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==} + engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.24.7': resolution: {integrity: sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==} engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.25.2': + resolution: {integrity: sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==} + engines: {node: '>=6.9.0'} + '@babel/helper-environment-visitor@7.24.7': resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} engines: {node: '>=6.9.0'} @@ -1864,6 +1880,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0 + '@babel/helper-module-transforms@7.25.2': + resolution: {integrity: sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/helper-plugin-utils@7.24.7': resolution: {integrity: sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==} engines: {node: '>=6.9.0'} @@ -1892,10 +1914,18 @@ packages: resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.24.8': + resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} + engines: {node: '>=6.9.0'} + '@babel/helpers@7.24.7': resolution: {integrity: sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==} engines: {node: '>=6.9.0'} + '@babel/helpers@7.25.6': + resolution: {integrity: sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==} + engines: {node: '>=6.9.0'} + '@babel/highlight@7.24.7': resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} @@ -1934,10 +1964,18 @@ packages: resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} engines: {node: '>=6.9.0'} + '@babel/template@7.25.0': + resolution: {integrity: sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==} + engines: {node: '>=6.9.0'} + '@babel/traverse@7.24.7': resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} engines: {node: '>=6.9.0'} + '@babel/traverse@7.25.6': + resolution: {integrity: sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==} + engines: {node: '>=6.9.0'} + '@babel/types@7.24.7': resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} engines: {node: '>=6.9.0'} @@ -2969,11 +3007,11 @@ packages: '@redocly/ajv@8.11.2': resolution: {integrity: sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==} - '@redocly/config@0.11.0': - resolution: {integrity: sha512-vAc77vCuWsVgLx2LN02P6jqLBhHuot6O1LsSJEAAkWEvXARSGSQVon50QW7jlbCMg9OFTYYYRPN4W6K/YmnM3w==} + '@redocly/config@0.12.1': + resolution: {integrity: sha512-RW3rSirfsPdr0uvATijRDU3f55SuZV3m7/ppdTDvGw4IB0cmeZRkFmqTrchxMqWP50Gfg1tpHnjdxUCNo0E2qg==} - '@redocly/openapi-core@1.25.3': - resolution: {integrity: sha512-dqJkyydgagW3FXX5cjtSUAnabsld4K6yq7RFgQ+ngI1m43PkEoSQt8pp+SfQDszSEoMbc7QKj8afbe7mZw17TA==} + '@redocly/openapi-core@1.25.4': + resolution: {integrity: sha512-qnpr4Z1rzfXdtxQxt/lfGD0wW3UVrm3qhrTpzLG5R/Ze+z+1u8sSRiQHp9N+RT3IuMjh00wq59nop9x9PPa1jQ==} engines: {node: '>=14.19.0', npm: '>=7.0.0'} '@rollup/pluginutils@5.1.0': @@ -3606,8 +3644,8 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - '@vitejs/plugin-react@4.3.1': - resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==} + '@vitejs/plugin-react@4.3.2': + resolution: {integrity: sha512-hieu+o05v4glEBucTcKMK3dlES0OeJlD9YVOAPraVMOInBCwzumaIFiUjr4bHK7NPgnAHgiskUoceKercrN8vg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.2.0 || ^5.0.0 @@ -5240,10 +5278,6 @@ packages: http2-client@1.3.5: resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} - https-proxy-agent@7.0.4: - resolution: {integrity: sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==} - engines: {node: '>= 14'} - https-proxy-agent@7.0.5: resolution: {integrity: sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==} engines: {node: '>= 14'} @@ -7993,6 +8027,8 @@ snapshots: '@babel/compat-data@7.24.7': {} + '@babel/compat-data@7.25.4': {} + '@babel/core@7.24.7': dependencies: '@ampproject/remapping': 2.3.0 @@ -8013,6 +8049,26 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/core@7.25.2': + dependencies: + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.24.7 + '@babel/generator': 7.25.6 + '@babel/helper-compilation-targets': 7.25.2 + '@babel/helper-module-transforms': 7.25.2(@babel/core@7.25.2) + '@babel/helpers': 7.25.6 + '@babel/parser': 7.25.6 + '@babel/template': 7.25.0 + '@babel/traverse': 7.25.6 + '@babel/types': 7.25.6 + convert-source-map: 2.0.0 + debug: 4.3.7 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + '@babel/generator@7.24.7': dependencies: '@babel/types': 7.24.7 @@ -8020,6 +8076,13 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 + '@babel/generator@7.25.6': + dependencies: + '@babel/types': 7.25.6 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 2.5.2 + '@babel/helper-compilation-targets@7.24.7': dependencies: '@babel/compat-data': 7.24.7 @@ -8028,6 +8091,14 @@ snapshots: lru-cache: 5.1.1 semver: 6.3.1 + '@babel/helper-compilation-targets@7.25.2': + dependencies: + '@babel/compat-data': 7.25.4 + '@babel/helper-validator-option': 7.24.8 + browserslist: 4.23.1 + lru-cache: 5.1.1 + semver: 6.3.1 + '@babel/helper-environment-visitor@7.24.7': dependencies: '@babel/types': 7.24.7 @@ -8059,6 +8130,16 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/helper-module-transforms@7.25.2(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-module-imports': 7.24.7 + '@babel/helper-simple-access': 7.24.7 + '@babel/helper-validator-identifier': 7.24.7 + '@babel/traverse': 7.25.6 + transitivePeerDependencies: + - supports-color + '@babel/helper-plugin-utils@7.24.7': {} '@babel/helper-simple-access@7.24.7': @@ -8080,11 +8161,18 @@ snapshots: '@babel/helper-validator-option@7.24.7': {} + '@babel/helper-validator-option@7.24.8': {} + '@babel/helpers@7.24.7': dependencies: '@babel/template': 7.24.7 '@babel/types': 7.24.7 + '@babel/helpers@7.25.6': + dependencies: + '@babel/template': 7.25.0 + '@babel/types': 7.25.6 + '@babel/highlight@7.24.7': dependencies: '@babel/helper-validator-identifier': 7.24.7 @@ -8100,14 +8188,14 @@ snapshots: dependencies: '@babel/types': 7.25.6 - '@babel/plugin-transform-react-jsx-self@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-react-jsx-self@7.24.7(@babel/core@7.25.2)': dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-react-jsx-source@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-react-jsx-source@7.24.7(@babel/core@7.25.2)': dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.24.7 '@babel/runtime@7.24.7': @@ -8122,6 +8210,12 @@ snapshots: '@babel/parser': 7.24.7 '@babel/types': 7.24.7 + '@babel/template@7.25.0': + dependencies: + '@babel/code-frame': 7.24.7 + '@babel/parser': 7.25.6 + '@babel/types': 7.25.6 + '@babel/traverse@7.24.7': dependencies: '@babel/code-frame': 7.24.7 @@ -8137,6 +8231,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/traverse@7.25.6': + dependencies: + '@babel/code-frame': 7.24.7 + '@babel/generator': 7.25.6 + '@babel/parser': 7.25.6 + '@babel/template': 7.25.0 + '@babel/types': 7.25.6 + debug: 4.3.7 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + '@babel/types@7.24.7': dependencies: '@babel/helper-string-parser': 7.24.7 @@ -8838,7 +8944,7 @@ snapshots: '@kubb/oas@3.0.0-alpha.17': dependencies: - '@redocly/openapi-core': 1.25.3 + '@redocly/openapi-core': 1.25.4 hotscript: 1.0.13 json-schema-to-ts: 3.1.1 oas: 24.9.0 @@ -9179,14 +9285,14 @@ snapshots: require-from-string: 2.0.2 uri-js-replace: 1.0.1 - '@redocly/config@0.11.0': {} + '@redocly/config@0.12.1': {} - '@redocly/openapi-core@1.25.3': + '@redocly/openapi-core@1.25.4': dependencies: '@redocly/ajv': 8.11.2 - '@redocly/config': 0.11.0 + '@redocly/config': 0.12.1 colorette: 1.4.0 - https-proxy-agent: 7.0.4 + https-proxy-agent: 7.0.5 js-levenshtein: 1.1.6 js-yaml: 4.1.0 lodash.isequal: 4.5.0 @@ -9582,24 +9688,24 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/parser': 7.25.6 + '@babel/types': 7.25.6 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.6 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.25.6 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/parser': 7.25.6 + '@babel/types': 7.25.6 '@types/babel__traverse@7.20.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.25.6 '@types/body-parser@1.19.5': dependencies: @@ -9773,11 +9879,11 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-react@4.3.1(vite@4.5.5(@types/node@20.16.10)(terser@5.31.1))': + '@vitejs/plugin-react@4.3.2(vite@4.5.5(@types/node@20.16.10)(terser@5.31.1))': dependencies: - '@babel/core': 7.24.7 - '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.24.7) + '@babel/core': 7.25.2 + '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2) + '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 vite: 4.5.5(@types/node@20.16.10)(terser@5.31.1) @@ -11774,13 +11880,6 @@ snapshots: http2-client@1.3.5: {} - https-proxy-agent@7.0.4: - dependencies: - agent-base: 7.1.1 - debug: 4.3.7 - transitivePeerDependencies: - - supports-color - https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.1 @@ -13149,7 +13248,7 @@ snapshots: agent-base: 7.1.1 debug: 4.3.7 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.4 + https-proxy-agent: 7.0.5 lru-cache: 7.18.3 pac-proxy-agent: 7.0.2 proxy-from-env: 1.1.0 @@ -13307,7 +13406,7 @@ snapshots: redoc@2.1.5(core-js@3.37.1)(enzyme@3.11.0)(mobx@6.13.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): dependencies: '@cfaester/enzyme-adapter-react-18': 0.8.0(enzyme@3.11.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@redocly/openapi-core': 1.25.3 + '@redocly/openapi-core': 1.25.4 classnames: 2.5.1 core-js: 3.37.1 decko: 1.2.0