diff --git a/.changeset/clean-apes-divide.md b/.changeset/clean-apes-divide.md new file mode 100644 index 0000000000..79f54b1f7e --- /dev/null +++ b/.changeset/clean-apes-divide.md @@ -0,0 +1,29 @@ +--- +'@hey-api/openapi-ts': patch +--- + +**output**: add `nameConflictResolver` option + +## Name Conflicts + +As your project grows, the chances of name conflicts increase. We use a simple conflict resolver that appends numeric suffixes to duplicate identifiers. If you prefer a different strategy, you can provide your own `nameConflictResolver` function. + +```js +export default { + input: 'hey-api/backend', // sign up at app.heyapi.dev + output: { + nameConflictResolver({ attempt, baseName }) { + return attempt === 0 ? baseName : `${baseName}_N${attempt + 1}`; + }, + path: 'src/client', + }, +}; +``` + +Example output: + +```ts +export type ChatCompletion = string; + +export type ChatCompletion_N2 = number; +``` diff --git a/.changeset/eight-rabbits-unite.md b/.changeset/eight-rabbits-unite.md new file mode 100644 index 0000000000..92bf77bce5 --- /dev/null +++ b/.changeset/eight-rabbits-unite.md @@ -0,0 +1,21 @@ +--- +'@hey-api/openapi-ts': minor +--- + +**output**: add `preferExportAll` option + +### Prefer named exports + +This release changes the default for `index.ts` to prefer named exports. Named exports may lead to better IDE and bundler performance compared to asterisk (`*`) as your tooling doesn't have to inspect the underlying module to discover exports. + +While this change is merely cosmetic, you can set `output.preferExportAll` to `true` if you prefer to use the asterisk. + +```js +export default { + input: 'hey-api/backend', // sign up at app.heyapi.dev + output: { + path: 'src/client', + preferExportAll: true, + }, +}; +``` diff --git a/.changeset/gentle-spoons-kneel.md b/.changeset/gentle-spoons-kneel.md new file mode 100644 index 0000000000..c588ffe29e --- /dev/null +++ b/.changeset/gentle-spoons-kneel.md @@ -0,0 +1,5 @@ +--- +'@hey-api/codegen-core': minor +--- + +**symbols**: remove `placeholder` property diff --git a/.changeset/plenty-walls-repeat.md b/.changeset/plenty-walls-repeat.md new file mode 100644 index 0000000000..2807c768e1 --- /dev/null +++ b/.changeset/plenty-walls-repeat.md @@ -0,0 +1,9 @@ +--- +'@hey-api/openapi-ts': minor +--- + +**parser**: removed `symbol:setValue:*` events + +### Removed `symbol:setValue:*` events + +These events have been removed in favor of `node:set:*` events. diff --git a/.vscode/launch.json b/.vscode/launch.json index edbd4ea4b7..e83d654b7e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,8 +15,7 @@ "skipFiles": ["/**"], "cwd": "${workspaceFolder}/dev", "runtimeExecutable": "node", - "runtimeArgs": ["-r", "ts-node/register/transpile-only"], - "program": "${workspaceFolder}/packages/openapi-ts/src/run.ts", + "program": "${workspaceFolder}/packages/openapi-ts/dist/run.mjs", "env": { "DEBUG": "false" } diff --git a/dev/openapi-ts.config.ts b/dev/openapi-ts.config.ts index f9906b457f..d3586b30d9 100644 --- a/dev/openapi-ts.config.ts +++ b/dev/openapi-ts.config.ts @@ -5,13 +5,16 @@ import path from 'node:path'; // @ts-ignore import { customClientPlugin } from '@hey-api/custom-client/plugin'; // @ts-ignore -import { defineConfig, utils } from '@hey-api/openapi-ts'; +import { defineConfig, reserved, utils } from '@hey-api/openapi-ts'; // @ts-ignore import { myClientPlugin } from '../packages/openapi-ts-tests/main/test/custom/client/plugin'; // @ts-ignore import { getSpecsPath } from '../packages/openapi-ts-tests/utils'; +reserved.runtime.set((list) => [...list, 'Agent']); +reserved.type.set((list) => [...list, 'Agent']); + // @ts-ignore export default defineConfig(() => { // ... @@ -39,15 +42,19 @@ export default defineConfig(() => { '3.1.x', // 'circular.yaml', // 'dutchie.json', + // 'enum-names-values.yaml', // 'invalid', // 'full.yaml', + // 'sdk-method-class-conflict.yaml', // 'object-property-names.yaml', - // 'openai.yaml', - 'opencode.yaml', + 'openai.yaml', + // 'opencode.yaml', // 'pagination-ref.yaml', // 'sdk-instance.yaml', + // 'sdk-nested-classes.yaml', // 'string-with-format.yaml', // 'transformers.json', + // 'transformers-recursive.json', // 'type-format.yaml', // 'validators.yaml', // 'validators-circular-ref.json', @@ -96,10 +103,21 @@ export default defineConfig(() => { // suffix: '.meh', // }, // format: 'prettier', - importFileExtension: '.ts', + // importFileExtension: '.js', // indexFile: false, // lint: 'eslint', + nameConflictResolver({ attempt, baseName }) { + // console.log('resolving conflict for:', { attempt, baseName }); + return attempt === 0 ? baseName : `${baseName}_N${attempt + 1}`; + }, path: path.resolve(__dirname, '.gen'), + // preferExportAll: true, + resolveModuleName: (moduleName) => { + if (moduleName === 'valibot') { + return 'valibot'; + } + return; + }, // tsConfigPath: path.resolve( // __dirname, // 'tsconfig', @@ -128,6 +146,14 @@ export default defineConfig(() => { }, hooks: { events: { + // 'node:set:after': ({ node, plugin }) => { + // if (node) { + // console.log(`(${plugin.name}) set node:`, node.symbol); + // } + // }, + // 'node:set:before': ({ node, plugin }) => { + // console.log(`(${plugin.name}) setting node:`, node?.symbol?.id); + // }, // 'plugin:handler:after': ({ plugin }) => { // console.log(`(${plugin.name}): handler finished`); // }, @@ -153,12 +179,6 @@ export default defineConfig(() => { // ); // } }, - // 'symbol:setValue:after': ({ plugin, symbol }) => { - // console.log(`(${plugin.name}) set value:`, symbol.id); - // }, - // 'symbol:setValue:before': ({ plugin, symbol }) => { - // console.log(`(${plugin.name}) setting value:`, symbol.id); - // }, }, operations: { getKind() { @@ -236,6 +256,7 @@ export default defineConfig(() => { // error: '他們_error_{{name}}', // name: '你們_errors_{{name}}', // }, + // exportFromIndex: false, name: '@hey-api/typescript', // requests: '我們_data_{{name}}', // responses: { @@ -261,10 +282,10 @@ export default defineConfig(() => { // fields.unwrap('path') // }, // include... - // instance: true, + instance: true, name: '@hey-api/sdk', // operationId: false, - paramsStructure: 'flat', + // paramsStructure: 'flat', // responseStyle: 'data', // signature: 'auto', // signature: 'client', @@ -305,9 +326,10 @@ export default defineConfig(() => { // case: 'SCREAMING_SNAKE_CASE', // comments: false, exportFromIndex: true, - // infiniteQueryKeys: { - // name: '{{name}}IQK', - // }, + infiniteQueryKeys: { + // name: '{{name}}IQK', + // name: 'options', + }, infiniteQueryOptions: { meta() { return { @@ -315,6 +337,7 @@ export default defineConfig(() => { }; }, // name: '{{name}}IQO', + // name: 'options', }, mutationOptions: { meta() { @@ -323,10 +346,12 @@ export default defineConfig(() => { }; }, // name: '{{name}}MO', + // name: 'options', }, name: '@tanstack/react-query', queryKeys: { // name: '{{name}}QK', + // name: 'options', tags: true, }, // queryOptions: false, @@ -336,7 +361,8 @@ export default defineConfig(() => { // custom: 'value', // } // }, - name: '{{name}}QO', + // name: '{{name}}QO', + // name: 'options', }, useQuery: true, '~hooks': { @@ -365,7 +391,7 @@ export default defineConfig(() => { { // case: 'SCREAMING_SNAKE_CASE', // comments: false, - // definitions: 'z{{name}}Definition', + definitions: 'z{{name}}', exportFromIndex: true, // metadata: true, // name: 'valibot', @@ -373,10 +399,10 @@ export default defineConfig(() => { // case: 'PascalCase', // name: '{{name}}Data', // }, - // responses: { - // // case: 'snake_case', - // name: 'z{{name}}TestResponse', - // }, + responses: { + // case: 'snake_case', + name: 'z{{name}}TestResponse', + }, // webhooks: { // name: 'q{{name}}CoolWebhook', // }, @@ -416,17 +442,23 @@ export default defineConfig(() => { // 'date-time': ({ $, pipes }) => pipes.push($('v').attr('isoDateTime').call()), }, }, - validator({ $, schema, v }) { - return [ - $.const('parsed').assign( - $(v.placeholder) - .attr('safeParseAsync') - .call(schema.placeholder, 'data') - .await(), - ), - $('parsed').return(), - ]; - }, + // validator({ $, plugin, schema, v }) { + // const vShadow = plugin.symbol('v'); + // const test = plugin.symbol('test'); + // const e = plugin.symbol('err'); + // return [ + // $.const(vShadow).assign($.literal('hi')), + // $('console').attr('log').call(vShadow), + // $.try( + // $.const(test).assign($.literal('test')), + // $('console').attr('log').call($.literal('hi'), test), + // ).catchArg(e), + // $.const('parsed').assign( + // $(v).attr('safeParseAsync').call(schema, 'data').await(), + // ), + // $('parsed').return(), + // ]; + // }, }, }, { @@ -443,7 +475,7 @@ export default defineConfig(() => { // infer: 'D{{name}}ZodType', // }, }, - // exportFromIndex: true, + exportFromIndex: true, metadata: true, // name: 'zod', // requests: { @@ -496,17 +528,14 @@ export default defineConfig(() => { // 'date-time': ({ $ }) => $('z').attr('date').call(), }, }, - validator({ $, schema }) { - return [ - $.const('parsed').assign( - $(schema.placeholder) - .attr('safeParseAsync') - .call('data') - .await(), - ), - $('parsed').return(), - ]; - }, + // validator({ $, schema }) { + // return [ + // $.const('parsed').assign( + // $(schema).attr('safeParseAsync').call('data').await(), + // ), + // $('parsed').return(), + // ]; + // }, }, }, { @@ -527,7 +556,7 @@ export default defineConfig(() => { { exportFromIndex: true, // mutationOptions: '{{name}}Mutationssss', - // name: '@pinia/colada', + name: '@pinia/colada', // queryOptions: { // name: '{{name}}Queryyyyy', // }, @@ -546,7 +575,6 @@ export default defineConfig(() => { }, }, ], - // useOptions: false, // watch: 3_000, }, // { diff --git a/docs/index.md b/docs/index.md index 9513b13c11..e5d4b0e1aa 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,8 +15,8 @@ hero: text: Roadmap theme: alt image: - alt: Two people looking at the blueprint - src: /images/blueprint-640w.png + alt: Two people looking at the TypeScript logo + src: /images/hero-920w.png features: - icon: diff --git a/docs/openapi-ts/configuration/output.md b/docs/openapi-ts/configuration/output.md index a47ace0e4d..10806b04d2 100644 --- a/docs/openapi-ts/configuration/output.md +++ b/docs/openapi-ts/configuration/output.md @@ -108,9 +108,9 @@ export default { ::: -## Import File Extension +## Module Extension -You can customize the extension used for imported TypeScript files. +You can customize the extension used for TypeScript modules. ::: code-group @@ -258,6 +258,34 @@ export default { You can also prevent your output from being linted by adding your output path to the linter's ignore file. +## Name Conflicts + +As your project grows, the chances of name conflicts increase. We use a simple conflict resolver that appends numeric suffixes to duplicate identifiers. If you prefer a different strategy, you can provide your own `nameConflictResolver` function. + +::: code-group + + +```js [config] +export default { + input: 'hey-api/backend', // sign up at app.heyapi.dev + output: { + nameConflictResolver({ attempt, baseName }) { // [!code ++] + return attempt === 0 ? baseName : `${baseName}_N${attempt + 1}`; // [!code ++] + }, // [!code ++] + path: 'src/client', + }, +}; +``` + + +```ts [example] +export type ChatCompletion = string; + +export type ChatCompletion_N2 = number; +``` + +::: + ## TSConfig Path We use the [TSConfig file](https://www.typescriptlang.org/tsconfig/) to generate output matching your project's settings. By default, we attempt to find a TSConfig file starting from the location of the `@hey-api/openapi-ts` configuration file and traversing up. diff --git a/docs/openapi-ts/migrating.md b/docs/openapi-ts/migrating.md index 39953f135d..063bfaf89d 100644 --- a/docs/openapi-ts/migrating.md +++ b/docs/openapi-ts/migrating.md @@ -7,6 +7,28 @@ description: Migrating to @hey-api/openapi-ts. While we try to avoid breaking changes, sometimes it's unavoidable in order to offer you the latest features. This page lists changes that require updates to your code. If you run into a problem with migration, please [open an issue](https://github.com/hey-api/openapi-ts/issues). +## v0.89.0 + +### Prefer named exports + +This release changes the default for `index.ts` to prefer named exports. Named exports may lead to better IDE and bundler performance compared to asterisk (`*`) as your tooling doesn't have to inspect the underlying module to discover exports. + +While this change is merely cosmetic, you can set `output.preferExportAll` to `true` if you prefer to use the asterisk. + +```js +export default { + input: 'hey-api/backend', // sign up at app.heyapi.dev + output: { + path: 'src/client', + preferExportAll: true, // [!code ++] + }, +}; +``` + +### Removed `symbol:setValue:*` events + +These events have been removed in favor of `node:set:*` events. + ## v0.88.0 ### Removed `compiler` and `tsc` exports diff --git a/docs/openapi-ts/output.md b/docs/openapi-ts/output.md index a949e215b4..cffd611a63 100644 --- a/docs/openapi-ts/output.md +++ b/docs/openapi-ts/output.md @@ -111,9 +111,5 @@ export default { }; ``` -::: warning -Re-exporting additional files from index file may result in broken output due to naming conflicts. -::: - diff --git a/docs/public/hero.png b/docs/public/hero.png new file mode 100644 index 0000000000..84a2da5705 Binary files /dev/null and b/docs/public/hero.png differ diff --git a/docs/public/images/hero-300w.png b/docs/public/images/hero-300w.png new file mode 100644 index 0000000000..4a640e3d93 Binary files /dev/null and b/docs/public/images/hero-300w.png differ diff --git a/docs/public/images/hero-640w.png b/docs/public/images/hero-640w.png new file mode 100644 index 0000000000..846bb84f2e Binary files /dev/null and b/docs/public/images/hero-640w.png differ diff --git a/docs/public/images/hero-920w.png b/docs/public/images/hero-920w.png new file mode 100644 index 0000000000..acba3b4f2f Binary files /dev/null and b/docs/public/images/hero-920w.png differ diff --git a/docs/scripts/optimize-images.js b/docs/scripts/optimize-images.js index 03a0885b26..1a6d0f7020 100644 --- a/docs/scripts/optimize-images.js +++ b/docs/scripts/optimize-images.js @@ -31,6 +31,23 @@ const images = [ ], source: 'bricks.png', }, + { + sizes: [ + { + formats: ['png'], + width: 300, + }, + { + formats: ['png'], + width: 640, + }, + { + formats: ['png'], + width: 920, + }, + ], + source: 'hero.png', + }, { sizes: [ { diff --git a/examples/openapi-ts-angular-common/src/client/index.ts b/examples/openapi-ts-angular-common/src/client/index.ts index 89fcd5868b..a173c9a803 100644 --- a/examples/openapi-ts-angular-common/src/client/index.ts +++ b/examples/openapi-ts-angular-common/src/client/index.ts @@ -1,5 +1,130 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './@angular/common.gen'; -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPetRequest, + createUserRequest, + createUsersWithListInputRequest, + deleteOrderRequest, + deletePetRequest, + deleteUserRequest, + findPetsByStatusRequest, + findPetsByTagsRequest, + getInventoryRequest, + getOrderByIdRequest, + getPetByIdRequest, + getUserByNameRequest, + loginUserRequest, + logoutUserRequest, + PetServiceResources, + placeOrderRequest, + StoreServiceResources, + updatePetRequest, + updatePetWithFormRequest, + updateUserRequest, + uploadFileRequest, + UserServiceResources, +} from './@angular/common.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-angular/src/client/index.ts b/examples/openapi-ts-angular/src/client/index.ts index 57ed02bf5f..12450a715c 100644 --- a/examples/openapi-ts-angular/src/client/index.ts +++ b/examples/openapi-ts-angular/src/client/index.ts @@ -1,4 +1,85 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { type Options, PetService, StoreService, UserService } from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-axios/src/client/index.ts b/examples/openapi-ts-axios/src/client/index.ts index 57ed02bf5f..75b9a8d127 100644 --- a/examples/openapi-ts-axios/src/client/index.ts +++ b/examples/openapi-ts-axios/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-fastify/src/client/index.ts b/examples/openapi-ts-fastify/src/client/index.ts index 57ed02bf5f..9b3d76871a 100644 --- a/examples/openapi-ts-fastify/src/client/index.ts +++ b/examples/openapi-ts-fastify/src/client/index.ts @@ -1,4 +1,23 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { createPets, listPets, type Options, showPetById } from './sdk.gen'; +export type { + ClientOptions, + CreatePetsData, + CreatePetsError, + CreatePetsErrors, + CreatePetsResponses, + Error, + ListPetsData, + ListPetsError, + ListPetsErrors, + ListPetsResponse, + ListPetsResponses, + Pet, + Pets, + ShowPetByIdData, + ShowPetByIdError, + ShowPetByIdErrors, + ShowPetByIdResponse, + ShowPetByIdResponses, +} from './types.gen'; diff --git a/examples/openapi-ts-fastify/src/client/types.gen.ts b/examples/openapi-ts-fastify/src/client/types.gen.ts index 054b6615e5..bd956ecb73 100644 --- a/examples/openapi-ts-fastify/src/client/types.gen.ts +++ b/examples/openapi-ts-fastify/src/client/types.gen.ts @@ -12,7 +12,7 @@ export type Pet = { export type Pets = Array; -export type _Error = { +export type Error = { code: number; message: string; }; @@ -33,7 +33,7 @@ export type ListPetsErrors = { /** * unexpected error */ - default: _Error; + default: Error; }; export type ListPetsError = ListPetsErrors[keyof ListPetsErrors]; @@ -58,7 +58,7 @@ export type CreatePetsErrors = { /** * unexpected error */ - default: _Error; + default: Error; }; export type CreatePetsError = CreatePetsErrors[keyof CreatePetsErrors]; @@ -86,7 +86,7 @@ export type ShowPetByIdErrors = { /** * unexpected error */ - default: _Error; + default: Error; }; export type ShowPetByIdError = ShowPetByIdErrors[keyof ShowPetByIdErrors]; diff --git a/examples/openapi-ts-fetch/src/client/index.ts b/examples/openapi-ts-fetch/src/client/index.ts index 57ed02bf5f..75b9a8d127 100644 --- a/examples/openapi-ts-fetch/src/client/index.ts +++ b/examples/openapi-ts-fetch/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-ky/src/client/index.ts b/examples/openapi-ts-ky/src/client/index.ts index 57ed02bf5f..75b9a8d127 100644 --- a/examples/openapi-ts-ky/src/client/index.ts +++ b/examples/openapi-ts-ky/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-next/src/client/index.ts b/examples/openapi-ts-next/src/client/index.ts index 57ed02bf5f..75b9a8d127 100644 --- a/examples/openapi-ts-next/src/client/index.ts +++ b/examples/openapi-ts-next/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-ofetch/src/client/index.ts b/examples/openapi-ts-ofetch/src/client/index.ts index 57ed02bf5f..75b9a8d127 100644 --- a/examples/openapi-ts-ofetch/src/client/index.ts +++ b/examples/openapi-ts-ofetch/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-openai/src/client/index.ts b/examples/openapi-ts-openai/src/client/index.ts index cc646f13a5..87dd223a30 100644 --- a/examples/openapi-ts-openai/src/client/index.ts +++ b/examples/openapi-ts-openai/src/client/index.ts @@ -1,4 +1,1156 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; +export { OpenAi, type Options } from './sdk.gen'; +export { + type ActivateOrganizationCertificatesData, + type ActivateOrganizationCertificatesResponse, + type ActivateOrganizationCertificatesResponses, + type ActivateProjectCertificatesData, + type ActivateProjectCertificatesResponse, + type ActivateProjectCertificatesResponses, + type AddUploadPartData, + type AddUploadPartRequest, + type AddUploadPartResponse, + type AddUploadPartResponses, + type AdminApiKey, + type AdminApiKeysCreateData, + type AdminApiKeysCreateResponse, + type AdminApiKeysCreateResponses, + type AdminApiKeysDeleteData, + type AdminApiKeysDeleteResponse, + type AdminApiKeysDeleteResponses, + type AdminApiKeysGetData, + type AdminApiKeysGetResponse, + type AdminApiKeysGetResponses, + type AdminApiKeysListData, + type AdminApiKeysListResponse, + type AdminApiKeysListResponses, + type Annotation, + type ApiKeyList, + type ApproximateLocation, + type ArchiveProjectData, + type ArchiveProjectResponse, + type ArchiveProjectResponses, + type AssistantObject, + type AssistantsApiResponseFormatOption, + type AssistantsApiToolChoiceOption, + type AssistantsNamedToolChoice, + type AssistantStreamEvent, + AssistantSupportedModels, + type AssistantTool, + type AssistantToolsCode, + type AssistantToolsFileSearch, + type AssistantToolsFileSearchTypeOnly, + type AssistantToolsFunction, + AudioResponseFormat, + type AuditLog, + type AuditLogActor, + type AuditLogActorApiKey, + type AuditLogActorServiceAccount, + type AuditLogActorSession, + type AuditLogActorUser, + AuditLogEventType, + type AutoChunkingStrategyRequestParam, + type Batch, + type BatchError, + type BatchFileExpirationAfter, + type BatchRequestCounts, + type BatchRequestInput, + type BatchRequestOutput, + type CancelBatchData, + type CancelBatchResponse, + type CancelBatchResponses, + type CancelEvalRunData, + type CancelEvalRunResponse, + type CancelEvalRunResponses, + type CancelFineTuningJobData, + type CancelFineTuningJobResponse, + type CancelFineTuningJobResponses, + type CancelResponseData, + type CancelResponseError, + type CancelResponseErrors, + type CancelResponseResponse, + type CancelResponseResponses, + type CancelRunData, + type CancelRunResponse, + type CancelRunResponses, + type CancelUploadData, + type CancelUploadResponse, + type CancelUploadResponses, + type CancelVectorStoreFileBatchData, + type CancelVectorStoreFileBatchResponse, + type CancelVectorStoreFileBatchResponses, + type Certificate, + type ChatCompletionAllowedTools, + type ChatCompletionAllowedToolsChoice, + type ChatCompletionDeleted, + type ChatCompletionFunctionCallOption, + type ChatCompletionFunctions, + type ChatCompletionList, + type ChatCompletionMessageCustomToolCall, + type ChatCompletionMessageList, + type ChatCompletionMessageToolCall, + type ChatCompletionMessageToolCallChunk, + type ChatCompletionMessageToolCalls, + type ChatCompletionModalities, + type ChatCompletionNamedToolChoice, + type ChatCompletionNamedToolChoiceCustom, + type ChatCompletionRequestAssistantMessage, + type ChatCompletionRequestAssistantMessageContentPart, + type ChatCompletionRequestDeveloperMessage, + type ChatCompletionRequestFunctionMessage, + type ChatCompletionRequestMessage, + type ChatCompletionRequestMessageContentPartAudio, + type ChatCompletionRequestMessageContentPartFile, + type ChatCompletionRequestMessageContentPartImage, + type ChatCompletionRequestMessageContentPartRefusal, + type ChatCompletionRequestMessageContentPartText, + type ChatCompletionRequestSystemMessage, + type ChatCompletionRequestSystemMessageContentPart, + type ChatCompletionRequestToolMessage, + type ChatCompletionRequestToolMessageContentPart, + type ChatCompletionRequestUserMessage, + type ChatCompletionRequestUserMessageContentPart, + type ChatCompletionResponseMessage, + ChatCompletionRole, + type ChatCompletionStreamOptions, + type ChatCompletionStreamResponseDelta, + type ChatCompletionTokenLogprob, + type ChatCompletionTool, + type ChatCompletionToolChoiceOption, + ChatModel, + type ChunkingStrategyRequestParam, + type ChunkingStrategyResponse, + type Click, + type ClientOptions, + type CodeInterpreterFileOutput, + type CodeInterpreterOutputImage, + type CodeInterpreterOutputLogs, + type CodeInterpreterTextOutput, + type CodeInterpreterTool, + type CodeInterpreterToolAuto, + type CodeInterpreterToolCall, + type ComparisonFilter, + type CompleteUploadData, + type CompleteUploadRequest, + type CompleteUploadResponse, + type CompleteUploadResponses, + type CompletionUsage, + type CompoundFilter, + type ComputerAction, + type ComputerCallOutputItemParam, + type ComputerCallSafetyCheckParam, + type ComputerScreenshotImage, + type ComputerToolCall, + type ComputerToolCallOutput, + type ComputerToolCallOutputResource, + type ComputerToolCallSafetyCheck, + type ComputerUsePreviewTool, + type ContainerFileCitationBody, + type ContainerFileListResource, + type ContainerFileResource, + type ContainerListResource, + type ContainerResource, + type Content, + type Coordinate, + type CostsResult, + type CreateAssistantData, + type CreateAssistantRequest, + type CreateAssistantResponse, + type CreateAssistantResponses, + type CreateBatchData, + type CreateBatchResponse, + type CreateBatchResponses, + type CreateChatCompletionData, + type CreateChatCompletionRequest, + type CreateChatCompletionResponse, + type CreateChatCompletionResponse2, + type CreateChatCompletionResponses, + type CreateChatCompletionStreamResponse, + type CreateCompletionData, + type CreateCompletionRequest, + type CreateCompletionResponse, + type CreateCompletionResponse2, + type CreateCompletionResponses, + type CreateContainerBody, + type CreateContainerData, + type CreateContainerFileBody, + type CreateContainerFileData, + type CreateContainerFileResponse, + type CreateContainerFileResponses, + type CreateContainerResponse, + type CreateContainerResponses, + type CreateEmbeddingData, + type CreateEmbeddingRequest, + type CreateEmbeddingResponse, + type CreateEmbeddingResponse2, + type CreateEmbeddingResponses, + type CreateEvalCompletionsRunDataSource, + type CreateEvalCustomDataSourceConfig, + type CreateEvalData, + type CreateEvalItem, + type CreateEvalJsonlRunDataSource, + type CreateEvalLabelModelGrader, + type CreateEvalLogsDataSourceConfig, + type CreateEvalRequest, + type CreateEvalResponse, + type CreateEvalResponses, + type CreateEvalResponsesRunDataSource, + type CreateEvalRunData, + type CreateEvalRunError, + type CreateEvalRunErrors, + type CreateEvalRunRequest, + type CreateEvalRunResponse, + type CreateEvalRunResponses, + type CreateEvalStoredCompletionsDataSourceConfig, + type CreateFileData, + type CreateFileRequest, + type CreateFileResponse, + type CreateFileResponses, + type CreateFineTuningCheckpointPermissionData, + type CreateFineTuningCheckpointPermissionRequest, + type CreateFineTuningCheckpointPermissionResponse, + type CreateFineTuningCheckpointPermissionResponses, + type CreateFineTuningJobData, + type CreateFineTuningJobRequest, + type CreateFineTuningJobResponse, + type CreateFineTuningJobResponses, + type CreateImageData, + type CreateImageEditData, + type CreateImageEditRequest, + type CreateImageEditResponse, + type CreateImageEditResponses, + type CreateImageRequest, + type CreateImageResponse, + type CreateImageResponses, + type CreateImageVariationData, + type CreateImageVariationRequest, + type CreateImageVariationResponse, + type CreateImageVariationResponses, + type CreateMessageData, + type CreateMessageRequest, + type CreateMessageResponse, + type CreateMessageResponses, + type CreateModelResponseProperties, + type CreateModerationData, + type CreateModerationRequest, + type CreateModerationResponse, + type CreateModerationResponse2, + type CreateModerationResponses, + type CreateProjectData, + type CreateProjectResponse, + type CreateProjectResponses, + type CreateProjectServiceAccountData, + type CreateProjectServiceAccountError, + type CreateProjectServiceAccountErrors, + type CreateProjectServiceAccountResponse, + type CreateProjectServiceAccountResponses, + type CreateProjectUserData, + type CreateProjectUserError, + type CreateProjectUserErrors, + type CreateProjectUserResponse, + type CreateProjectUserResponses, + type CreateRealtimeSessionData, + type CreateRealtimeSessionResponse, + type CreateRealtimeSessionResponses, + type CreateRealtimeTranscriptionSessionData, + type CreateRealtimeTranscriptionSessionResponse, + type CreateRealtimeTranscriptionSessionResponses, + type CreateResponse, + type CreateResponseData, + type CreateResponseResponse, + type CreateResponseResponses, + type CreateRunData, + type CreateRunRequest, + type CreateRunRequestWithoutStream, + type CreateRunResponse, + type CreateRunResponses, + type CreateSpeechData, + type CreateSpeechRequest, + type CreateSpeechResponse, + type CreateSpeechResponses, + type CreateSpeechResponseStreamEvent, + type CreateThreadAndRunData, + type CreateThreadAndRunRequest, + type CreateThreadAndRunRequestWithoutStream, + type CreateThreadAndRunResponse, + type CreateThreadAndRunResponses, + type CreateThreadData, + type CreateThreadRequest, + type CreateThreadResponse, + type CreateThreadResponses, + type CreateTranscriptionData, + type CreateTranscriptionRequest, + type CreateTranscriptionResponse, + type CreateTranscriptionResponseJson, + type CreateTranscriptionResponses, + type CreateTranscriptionResponseStreamEvent, + type CreateTranscriptionResponseVerboseJson, + type CreateTranslationData, + type CreateTranslationRequest, + type CreateTranslationResponse, + type CreateTranslationResponseJson, + type CreateTranslationResponses, + type CreateTranslationResponseVerboseJson, + type CreateUploadData, + type CreateUploadRequest, + type CreateUploadResponse, + type CreateUploadResponses, + type CreateVectorStoreData, + type CreateVectorStoreFileBatchData, + type CreateVectorStoreFileBatchRequest, + type CreateVectorStoreFileBatchResponse, + type CreateVectorStoreFileBatchResponses, + type CreateVectorStoreFileData, + type CreateVectorStoreFileRequest, + type CreateVectorStoreFileResponse, + type CreateVectorStoreFileResponses, + type CreateVectorStoreRequest, + type CreateVectorStoreResponse, + type CreateVectorStoreResponses, + type CustomTool, + type CustomToolCall, + type CustomToolCallOutput, + type CustomToolChatCompletions, + type DeactivateOrganizationCertificatesData, + type DeactivateOrganizationCertificatesResponse, + type DeactivateOrganizationCertificatesResponses, + type DeactivateProjectCertificatesData, + type DeactivateProjectCertificatesResponse, + type DeactivateProjectCertificatesResponses, + type DeleteAssistantData, + type DeleteAssistantResponse, + type DeleteAssistantResponse2, + type DeleteAssistantResponses, + type DeleteCertificateData, + type DeleteCertificateResponse, + type DeleteCertificateResponse2, + type DeleteCertificateResponses, + type DeleteChatCompletionData, + type DeleteChatCompletionResponse, + type DeleteChatCompletionResponses, + type DeleteContainerData, + type DeleteContainerFileData, + type DeleteContainerFileResponses, + type DeleteContainerResponses, + type DeleteEvalData, + type DeleteEvalError, + type DeleteEvalErrors, + type DeleteEvalResponse, + type DeleteEvalResponses, + type DeleteEvalRunData, + type DeleteEvalRunError, + type DeleteEvalRunErrors, + type DeleteEvalRunResponse, + type DeleteEvalRunResponses, + type DeleteFileData, + type DeleteFileResponse, + type DeleteFileResponse2, + type DeleteFileResponses, + type DeleteFineTuningCheckpointPermissionData, + type DeleteFineTuningCheckpointPermissionResponse, + type DeleteFineTuningCheckpointPermissionResponse2, + type DeleteFineTuningCheckpointPermissionResponses, + type DeleteInviteData, + type DeleteInviteResponse, + type DeleteInviteResponses, + type DeleteMessageData, + type DeleteMessageResponse, + type DeleteMessageResponse2, + type DeleteMessageResponses, + type DeleteModelData, + type DeleteModelResponse, + type DeleteModelResponse2, + type DeleteModelResponses, + type DeleteProjectApiKeyData, + type DeleteProjectApiKeyError, + type DeleteProjectApiKeyErrors, + type DeleteProjectApiKeyResponse, + type DeleteProjectApiKeyResponses, + type DeleteProjectServiceAccountData, + type DeleteProjectServiceAccountResponse, + type DeleteProjectServiceAccountResponses, + type DeleteProjectUserData, + type DeleteProjectUserError, + type DeleteProjectUserErrors, + type DeleteProjectUserResponse, + type DeleteProjectUserResponses, + type DeleteResponseData, + type DeleteResponseError, + type DeleteResponseErrors, + type DeleteResponseResponses, + type DeleteThreadData, + type DeleteThreadResponse, + type DeleteThreadResponse2, + type DeleteThreadResponses, + type DeleteUserData, + type DeleteUserResponse, + type DeleteUserResponses, + type DeleteVectorStoreData, + type DeleteVectorStoreFileData, + type DeleteVectorStoreFileResponse, + type DeleteVectorStoreFileResponse2, + type DeleteVectorStoreFileResponses, + type DeleteVectorStoreResponse, + type DeleteVectorStoreResponse2, + type DeleteVectorStoreResponses, + type DoneEvent, + type DoubleClick, + type DownloadFileData, + type DownloadFileResponse, + type DownloadFileResponses, + type Drag, + type EasyInputMessage, + type Embedding, + type Error, + type ErrorEvent, + type ErrorResponse, + type Eval, + type EvalApiError, + type EvalCustomDataSourceConfig, + type EvalGraderLabelModel, + type EvalGraderPython, + type EvalGraderScoreModel, + type EvalGraderStringCheck, + type EvalGraderTextSimilarity, + type EvalItem, + type EvalJsonlFileContentSource, + type EvalJsonlFileIdSource, + type EvalList, + type EvalLogsDataSourceConfig, + type EvalResponsesSource, + type EvalRun, + type EvalRunList, + type EvalRunOutputItem, + type EvalRunOutputItemList, + type EvalStoredCompletionsDataSourceConfig, + type EvalStoredCompletionsSource, + type FileCitationBody, + type FileExpirationAfter, + type FilePath, + FilePurpose, + FileSearchRanker, + type FileSearchRankingOptions, + type FileSearchTool, + type FileSearchToolCall, + type Filters, + type FineTuneChatCompletionRequestAssistantMessage, + type FineTuneChatRequestInput, + type FineTuneDpoHyperparameters, + type FineTuneDpoMethod, + type FineTuneMethod, + type FineTunePreferenceRequestInput, + type FineTuneReinforcementHyperparameters, + type FineTuneReinforcementMethod, + type FineTuneReinforcementRequestInput, + type FineTuneSupervisedHyperparameters, + type FineTuneSupervisedMethod, + type FineTuningCheckpointPermission, + type FineTuningIntegration, + type FineTuningJob, + type FineTuningJobCheckpoint, + type FineTuningJobEvent, + type FunctionCallOutputItemParam, + type FunctionObject, + type FunctionParameters, + type FunctionTool, + type FunctionToolCall, + type FunctionToolCallOutput, + type FunctionToolCallOutputResource, + type FunctionToolCallResource, + type GetAssistantData, + type GetAssistantResponse, + type GetAssistantResponses, + type GetCertificateData, + type GetCertificateResponse, + type GetCertificateResponses, + type GetChatCompletionData, + type GetChatCompletionMessagesData, + type GetChatCompletionMessagesResponse, + type GetChatCompletionMessagesResponses, + type GetChatCompletionResponse, + type GetChatCompletionResponses, + type GetEvalData, + type GetEvalResponse, + type GetEvalResponses, + type GetEvalRunData, + type GetEvalRunOutputItemData, + type GetEvalRunOutputItemResponse, + type GetEvalRunOutputItemResponses, + type GetEvalRunOutputItemsData, + type GetEvalRunOutputItemsResponse, + type GetEvalRunOutputItemsResponses, + type GetEvalRunResponse, + type GetEvalRunResponses, + type GetEvalRunsData, + type GetEvalRunsResponse, + type GetEvalRunsResponses, + type GetMessageData, + type GetMessageResponse, + type GetMessageResponses, + type GetResponseData, + type GetResponseResponse, + type GetResponseResponses, + type GetRunData, + type GetRunResponse, + type GetRunResponses, + type GetRunStepData, + type GetRunStepResponse, + type GetRunStepResponses, + type GetThreadData, + type GetThreadResponse, + type GetThreadResponses, + type GetVectorStoreData, + type GetVectorStoreFileBatchData, + type GetVectorStoreFileBatchResponse, + type GetVectorStoreFileBatchResponses, + type GetVectorStoreFileData, + type GetVectorStoreFileResponse, + type GetVectorStoreFileResponses, + type GetVectorStoreResponse, + type GetVectorStoreResponses, + type GraderLabelModel, + type GraderMulti, + type GraderPython, + type GraderScoreModel, + type GraderStringCheck, + type GraderTextSimilarity, + type Image, + type ImageEditCompletedEvent, + type ImageEditPartialImageEvent, + type ImageEditStreamEvent, + type ImageGenCompletedEvent, + type ImageGenInputUsageDetails, + type ImageGenPartialImageEvent, + type ImageGenStreamEvent, + type ImageGenTool, + type ImageGenToolCall, + type ImageGenUsage, + ImageInputFidelity, + type ImagesResponse, + type ImagesUsage, + Includable, + type InputAudio, + type InputContent, + type InputFileContent, + type InputImageContent, + type InputItem, + type InputMessage, + type InputMessageContentList, + type InputMessageResource, + type InputTextContent, + type Invite, + type InviteDeleteResponse, + type InviteListResponse, + type InviteRequest, + type InviteUserData, + type InviteUserResponse, + type InviteUserResponses, + type Item, + type ItemReferenceParam, + type ItemResource, + type KeyPress, + type ListAssistantsData, + type ListAssistantsResponse, + type ListAssistantsResponse2, + type ListAssistantsResponses, + type ListAuditLogsData, + type ListAuditLogsResponse, + type ListAuditLogsResponse2, + type ListAuditLogsResponses, + type ListBatchesData, + type ListBatchesResponse, + type ListBatchesResponse2, + type ListBatchesResponses, + type ListCertificatesResponse, + type ListChatCompletionsData, + type ListChatCompletionsResponse, + type ListChatCompletionsResponses, + type ListContainerFilesData, + type ListContainerFilesResponse, + type ListContainerFilesResponses, + type ListContainersData, + type ListContainersResponse, + type ListContainersResponses, + type ListEvalsData, + type ListEvalsResponse, + type ListEvalsResponses, + type ListFilesData, + type ListFilesInVectorStoreBatchData, + type ListFilesInVectorStoreBatchResponse, + type ListFilesInVectorStoreBatchResponses, + type ListFilesResponse, + type ListFilesResponse2, + type ListFilesResponses, + type ListFineTuningCheckpointPermissionResponse, + type ListFineTuningCheckpointPermissionsData, + type ListFineTuningCheckpointPermissionsResponse, + type ListFineTuningCheckpointPermissionsResponses, + type ListFineTuningEventsData, + type ListFineTuningEventsResponse, + type ListFineTuningEventsResponses, + type ListFineTuningJobCheckpointsData, + type ListFineTuningJobCheckpointsResponse, + type ListFineTuningJobCheckpointsResponse2, + type ListFineTuningJobCheckpointsResponses, + type ListFineTuningJobEventsResponse, + type ListInputItemsData, + type ListInputItemsResponse, + type ListInputItemsResponses, + type ListInvitesData, + type ListInvitesResponse, + type ListInvitesResponses, + type ListMessagesData, + type ListMessagesResponse, + type ListMessagesResponse2, + type ListMessagesResponses, + type ListModelsData, + type ListModelsResponse, + type ListModelsResponse2, + type ListModelsResponses, + type ListOrganizationCertificatesData, + type ListOrganizationCertificatesResponse, + type ListOrganizationCertificatesResponses, + type ListPaginatedFineTuningJobsData, + type ListPaginatedFineTuningJobsResponse, + type ListPaginatedFineTuningJobsResponse2, + type ListPaginatedFineTuningJobsResponses, + type ListProjectApiKeysData, + type ListProjectApiKeysResponse, + type ListProjectApiKeysResponses, + type ListProjectCertificatesData, + type ListProjectCertificatesResponse, + type ListProjectCertificatesResponses, + type ListProjectRateLimitsData, + type ListProjectRateLimitsResponse, + type ListProjectRateLimitsResponses, + type ListProjectsData, + type ListProjectServiceAccountsData, + type ListProjectServiceAccountsError, + type ListProjectServiceAccountsErrors, + type ListProjectServiceAccountsResponse, + type ListProjectServiceAccountsResponses, + type ListProjectsResponse, + type ListProjectsResponses, + type ListProjectUsersData, + type ListProjectUsersError, + type ListProjectUsersErrors, + type ListProjectUsersResponse, + type ListProjectUsersResponses, + type ListRunsData, + type ListRunsResponse, + type ListRunsResponse2, + type ListRunsResponses, + type ListRunStepsData, + type ListRunStepsResponse, + type ListRunStepsResponse2, + type ListRunStepsResponses, + type ListUsersData, + type ListUsersResponse, + type ListUsersResponses, + type ListVectorStoreFilesData, + type ListVectorStoreFilesResponse, + type ListVectorStoreFilesResponse2, + type ListVectorStoreFilesResponses, + type ListVectorStoresData, + type ListVectorStoresResponse, + type ListVectorStoresResponse2, + type ListVectorStoresResponses, + type LocalShellExecAction, + type LocalShellTool, + type LocalShellToolCall, + type LocalShellToolCallOutput, + type LogProb, + type LogProbProperties, + type McpApprovalRequest, + type McpApprovalResponse, + type McpApprovalResponseResource, + type McpListTools, + type McpListToolsTool, + type McpTool, + type McpToolCall, + type MessageContent, + type MessageContentDelta, + type MessageContentImageFileObject, + type MessageContentImageUrlObject, + type MessageContentRefusalObject, + type MessageContentTextAnnotationsFileCitationObject, + type MessageContentTextAnnotationsFilePathObject, + type MessageContentTextObject, + type MessageDeltaContentImageFileObject, + type MessageDeltaContentImageUrlObject, + type MessageDeltaContentRefusalObject, + type MessageDeltaContentTextAnnotationsFileCitationObject, + type MessageDeltaContentTextAnnotationsFilePathObject, + type MessageDeltaContentTextObject, + type MessageDeltaObject, + type MessageObject, + type MessageRequestContentTextObject, + type MessageStreamEvent, + type Metadata, + type Model, + type ModelIds, + type ModelIdsResponses, + type ModelIdsShared, + type ModelResponseProperties, + type ModerationImageUrlInput, + type ModerationTextInput, + type ModifyAssistantData, + type ModifyAssistantRequest, + type ModifyAssistantResponse, + type ModifyAssistantResponses, + type ModifyCertificateData, + type ModifyCertificateRequest, + type ModifyCertificateResponse, + type ModifyCertificateResponses, + type ModifyMessageData, + type ModifyMessageRequest, + type ModifyMessageResponse, + type ModifyMessageResponses, + type ModifyProjectData, + type ModifyProjectError, + type ModifyProjectErrors, + type ModifyProjectResponse, + type ModifyProjectResponses, + type ModifyProjectUserData, + type ModifyProjectUserError, + type ModifyProjectUserErrors, + type ModifyProjectUserResponse, + type ModifyProjectUserResponses, + type ModifyRunData, + type ModifyRunRequest, + type ModifyRunResponse, + type ModifyRunResponses, + type ModifyThreadData, + type ModifyThreadRequest, + type ModifyThreadResponse, + type ModifyThreadResponses, + type ModifyUserData, + type ModifyUserResponse, + type ModifyUserResponses, + type ModifyVectorStoreData, + type ModifyVectorStoreResponse, + type ModifyVectorStoreResponses, + type Move, + type OpenAiFile, + type OtherChunkingStrategyResponseParam, + type OutputAudio, + type OutputContent, + type OutputItem, + type OutputMessage, + type OutputTextContent, + type ParallelToolCalls, + type PartialImages, + type PauseFineTuningJobData, + type PauseFineTuningJobResponse, + type PauseFineTuningJobResponses, + type PostBatchCancelledWebhookPayload, + type PostBatchCancelledWebhookRequest, + type PostBatchCompletedWebhookPayload, + type PostBatchCompletedWebhookRequest, + type PostBatchExpiredWebhookPayload, + type PostBatchExpiredWebhookRequest, + type PostBatchFailedWebhookPayload, + type PostBatchFailedWebhookRequest, + type PostEvalRunCanceledWebhookPayload, + type PostEvalRunCanceledWebhookRequest, + type PostEvalRunFailedWebhookPayload, + type PostEvalRunFailedWebhookRequest, + type PostEvalRunSucceededWebhookPayload, + type PostEvalRunSucceededWebhookRequest, + type PostFineTuningJobCancelledWebhookPayload, + type PostFineTuningJobCancelledWebhookRequest, + type PostFineTuningJobFailedWebhookPayload, + type PostFineTuningJobFailedWebhookRequest, + type PostFineTuningJobSucceededWebhookPayload, + type PostFineTuningJobSucceededWebhookRequest, + type PostResponseCancelledWebhookPayload, + type PostResponseCancelledWebhookRequest, + type PostResponseCompletedWebhookPayload, + type PostResponseCompletedWebhookRequest, + type PostResponseFailedWebhookPayload, + type PostResponseFailedWebhookRequest, + type PostResponseIncompleteWebhookPayload, + type PostResponseIncompleteWebhookRequest, + type PredictionContent, + type Project, + type ProjectApiKey, + type ProjectApiKeyDeleteResponse, + type ProjectApiKeyListResponse, + type ProjectCreateRequest, + type ProjectListResponse, + type ProjectRateLimit, + type ProjectRateLimitListResponse, + type ProjectRateLimitUpdateRequest, + type ProjectServiceAccount, + type ProjectServiceAccountApiKey, + type ProjectServiceAccountCreateRequest, + type ProjectServiceAccountCreateResponse, + type ProjectServiceAccountDeleteResponse, + type ProjectServiceAccountListResponse, + type ProjectUpdateRequest, + type ProjectUser, + type ProjectUserCreateRequest, + type ProjectUserDeleteResponse, + type ProjectUserListResponse, + type ProjectUserUpdateRequest, + type Prompt, + type RankingOptions, + type RealtimeClientEvent, + type RealtimeClientEventConversationItemCreate, + type RealtimeClientEventConversationItemDelete, + type RealtimeClientEventConversationItemRetrieve, + type RealtimeClientEventConversationItemTruncate, + type RealtimeClientEventInputAudioBufferAppend, + type RealtimeClientEventInputAudioBufferClear, + type RealtimeClientEventInputAudioBufferCommit, + type RealtimeClientEventOutputAudioBufferClear, + type RealtimeClientEventResponseCancel, + type RealtimeClientEventResponseCreate, + type RealtimeClientEventSessionUpdate, + type RealtimeClientEventTranscriptionSessionUpdate, + type RealtimeConnectParams, + type RealtimeConversationItem, + type RealtimeConversationItemContent, + type RealtimeConversationItemWithReference, + type RealtimeResponse, + type RealtimeResponseCreateParams, + type RealtimeServerEvent, + type RealtimeServerEventConversationCreated, + type RealtimeServerEventConversationItemCreated, + type RealtimeServerEventConversationItemDeleted, + type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + type RealtimeServerEventConversationItemInputAudioTranscriptionDelta, + type RealtimeServerEventConversationItemInputAudioTranscriptionFailed, + type RealtimeServerEventConversationItemRetrieved, + type RealtimeServerEventConversationItemTruncated, + type RealtimeServerEventError, + type RealtimeServerEventInputAudioBufferCleared, + type RealtimeServerEventInputAudioBufferCommitted, + type RealtimeServerEventInputAudioBufferSpeechStarted, + type RealtimeServerEventInputAudioBufferSpeechStopped, + type RealtimeServerEventOutputAudioBufferCleared, + type RealtimeServerEventOutputAudioBufferStarted, + type RealtimeServerEventOutputAudioBufferStopped, + type RealtimeServerEventRateLimitsUpdated, + type RealtimeServerEventResponseAudioDelta, + type RealtimeServerEventResponseAudioDone, + type RealtimeServerEventResponseAudioTranscriptDelta, + type RealtimeServerEventResponseAudioTranscriptDone, + type RealtimeServerEventResponseContentPartAdded, + type RealtimeServerEventResponseContentPartDone, + type RealtimeServerEventResponseCreated, + type RealtimeServerEventResponseDone, + type RealtimeServerEventResponseFunctionCallArgumentsDelta, + type RealtimeServerEventResponseFunctionCallArgumentsDone, + type RealtimeServerEventResponseOutputItemAdded, + type RealtimeServerEventResponseOutputItemDone, + type RealtimeServerEventResponseTextDelta, + type RealtimeServerEventResponseTextDone, + type RealtimeServerEventSessionCreated, + type RealtimeServerEventSessionUpdated, + type RealtimeServerEventTranscriptionSessionUpdated, + type RealtimeSession, + type RealtimeSessionCreateRequest, + type RealtimeSessionCreateResponse, + type RealtimeTranscriptionSessionCreateRequest, + type RealtimeTranscriptionSessionCreateResponse, + type Reasoning, + ReasoningEffort, + type ReasoningItem, + type RefusalContent, + type Response, + type ResponseAudioDeltaEvent, + type ResponseAudioDoneEvent, + type ResponseAudioTranscriptDeltaEvent, + type ResponseAudioTranscriptDoneEvent, + type ResponseCodeInterpreterCallCodeDeltaEvent, + type ResponseCodeInterpreterCallCodeDoneEvent, + type ResponseCodeInterpreterCallCompletedEvent, + type ResponseCodeInterpreterCallInProgressEvent, + type ResponseCodeInterpreterCallInterpretingEvent, + type ResponseCompletedEvent, + type ResponseContentPartAddedEvent, + type ResponseContentPartDoneEvent, + type ResponseCreatedEvent, + type ResponseCustomToolCallInputDeltaEvent, + type ResponseCustomToolCallInputDoneEvent, + type ResponseError, + ResponseErrorCode, + type ResponseErrorEvent, + type ResponseFailedEvent, + type ResponseFileSearchCallCompletedEvent, + type ResponseFileSearchCallInProgressEvent, + type ResponseFileSearchCallSearchingEvent, + type ResponseFormatJsonObject, + type ResponseFormatJsonSchema, + type ResponseFormatJsonSchemaSchema, + type ResponseFormatText, + type ResponseFormatTextGrammar, + type ResponseFormatTextPython, + type ResponseFunctionCallArgumentsDeltaEvent, + type ResponseFunctionCallArgumentsDoneEvent, + type ResponseImageGenCallCompletedEvent, + type ResponseImageGenCallGeneratingEvent, + type ResponseImageGenCallInProgressEvent, + type ResponseImageGenCallPartialImageEvent, + type ResponseIncompleteEvent, + type ResponseInProgressEvent, + type ResponseItemList, + type ResponseLogProb, + type ResponseMcpCallArgumentsDeltaEvent, + type ResponseMcpCallArgumentsDoneEvent, + type ResponseMcpCallCompletedEvent, + type ResponseMcpCallFailedEvent, + type ResponseMcpCallInProgressEvent, + type ResponseMcpListToolsCompletedEvent, + type ResponseMcpListToolsFailedEvent, + type ResponseMcpListToolsInProgressEvent, + type ResponseModalities, + type ResponseOutputItemAddedEvent, + type ResponseOutputItemDoneEvent, + type ResponseOutputTextAnnotationAddedEvent, + type ResponsePromptVariables, + type ResponseProperties, + type ResponseQueuedEvent, + type ResponseReasoningSummaryPartAddedEvent, + type ResponseReasoningSummaryPartDoneEvent, + type ResponseReasoningSummaryTextDeltaEvent, + type ResponseReasoningSummaryTextDoneEvent, + type ResponseReasoningTextDeltaEvent, + type ResponseReasoningTextDoneEvent, + type ResponseRefusalDeltaEvent, + type ResponseRefusalDoneEvent, + type ResponseStreamEvent, + type ResponseStreamOptions, + type ResponseTextDeltaEvent, + type ResponseTextDoneEvent, + type ResponseUsage, + type ResponseWebSearchCallCompletedEvent, + type ResponseWebSearchCallInProgressEvent, + type ResponseWebSearchCallSearchingEvent, + type ResumeFineTuningJobData, + type ResumeFineTuningJobResponse, + type ResumeFineTuningJobResponses, + type RetrieveBatchData, + type RetrieveBatchResponse, + type RetrieveBatchResponses, + type RetrieveContainerData, + type RetrieveContainerFileContentData, + type RetrieveContainerFileContentResponses, + type RetrieveContainerFileData, + type RetrieveContainerFileResponse, + type RetrieveContainerFileResponses, + type RetrieveContainerResponse, + type RetrieveContainerResponses, + type RetrieveFileData, + type RetrieveFileResponse, + type RetrieveFileResponses, + type RetrieveFineTuningJobData, + type RetrieveFineTuningJobResponse, + type RetrieveFineTuningJobResponses, + type RetrieveInviteData, + type RetrieveInviteResponse, + type RetrieveInviteResponses, + type RetrieveModelData, + type RetrieveModelResponse, + type RetrieveModelResponses, + type RetrieveProjectApiKeyData, + type RetrieveProjectApiKeyResponse, + type RetrieveProjectApiKeyResponses, + type RetrieveProjectData, + type RetrieveProjectResponse, + type RetrieveProjectResponses, + type RetrieveProjectServiceAccountData, + type RetrieveProjectServiceAccountResponse, + type RetrieveProjectServiceAccountResponses, + type RetrieveProjectUserData, + type RetrieveProjectUserResponse, + type RetrieveProjectUserResponses, + type RetrieveUserData, + type RetrieveUserResponse, + type RetrieveUserResponses, + type RetrieveVectorStoreFileContentData, + type RetrieveVectorStoreFileContentResponse, + type RetrieveVectorStoreFileContentResponses, + type RunCompletionUsage, + type RunGraderData, + type RunGraderRequest, + type RunGraderResponse, + type RunGraderResponse2, + type RunGraderResponses, + type RunObject, + RunStatus, + type RunStepCompletionUsage, + type RunStepDeltaObject, + type RunStepDeltaObjectDelta, + type RunStepDeltaStepDetailsMessageCreationObject, + type RunStepDeltaStepDetailsToolCall, + type RunStepDeltaStepDetailsToolCallsCodeObject, + type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject, + type RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject, + type RunStepDeltaStepDetailsToolCallsFileSearchObject, + type RunStepDeltaStepDetailsToolCallsFunctionObject, + type RunStepDeltaStepDetailsToolCallsObject, + type RunStepDetailsMessageCreationObject, + type RunStepDetailsToolCall, + type RunStepDetailsToolCallsCodeObject, + type RunStepDetailsToolCallsCodeOutputImageObject, + type RunStepDetailsToolCallsCodeOutputLogsObject, + type RunStepDetailsToolCallsFileSearchObject, + type RunStepDetailsToolCallsFileSearchRankingOptionsObject, + type RunStepDetailsToolCallsFileSearchResultObject, + type RunStepDetailsToolCallsFunctionObject, + type RunStepDetailsToolCallsObject, + type RunStepObject, + type RunStepStreamEvent, + type RunStreamEvent, + type RunToolCallObject, + type Screenshot, + type Scroll, + type SearchVectorStoreData, + type SearchVectorStoreResponse, + type SearchVectorStoreResponses, + ServiceTier, + type SpeechAudioDeltaEvent, + type SpeechAudioDoneEvent, + type StaticChunkingStrategy, + type StaticChunkingStrategyRequestParam, + type StaticChunkingStrategyResponseParam, + type StopConfiguration, + type SubmitToolOuputsToRunData, + type SubmitToolOuputsToRunResponse, + type SubmitToolOuputsToRunResponses, + type SubmitToolOutputsRunRequest, + type SubmitToolOutputsRunRequestWithoutStream, + type TextAnnotation, + type TextAnnotationDelta, + type TextResponseFormatConfiguration, + type TextResponseFormatJsonSchema, + type ThreadObject, + type ThreadStreamEvent, + type ToggleCertificatesRequest, + type Tool, + type ToolChoiceAllowed, + type ToolChoiceCustom, + type ToolChoiceFunction, + type ToolChoiceMcp, + ToolChoiceOptions, + type ToolChoiceTypes, + type TopLogProb, + type TranscriptionChunkingStrategy, + TranscriptionInclude, + type TranscriptionSegment, + type TranscriptionWord, + type TranscriptTextDeltaEvent, + type TranscriptTextDoneEvent, + type TranscriptTextUsageDuration, + type TranscriptTextUsageTokens, + type TruncationObject, + type Type, + type UpdateChatCompletionData, + type UpdateChatCompletionResponse, + type UpdateChatCompletionResponses, + type UpdateEvalData, + type UpdateEvalResponse, + type UpdateEvalResponses, + type UpdateProjectRateLimitsData, + type UpdateProjectRateLimitsError, + type UpdateProjectRateLimitsErrors, + type UpdateProjectRateLimitsResponse, + type UpdateProjectRateLimitsResponses, + type UpdateVectorStoreFileAttributesData, + type UpdateVectorStoreFileAttributesRequest, + type UpdateVectorStoreFileAttributesResponse, + type UpdateVectorStoreFileAttributesResponses, + type UpdateVectorStoreRequest, + type Upload, + type UploadCertificateData, + type UploadCertificateRequest, + type UploadCertificateResponse, + type UploadCertificateResponses, + type UploadPart, + type UrlCitationBody, + type UsageAudioSpeechesData, + type UsageAudioSpeechesResponse, + type UsageAudioSpeechesResponses, + type UsageAudioSpeechesResult, + type UsageAudioTranscriptionsData, + type UsageAudioTranscriptionsResponse, + type UsageAudioTranscriptionsResponses, + type UsageAudioTranscriptionsResult, + type UsageCodeInterpreterSessionsData, + type UsageCodeInterpreterSessionsResponse, + type UsageCodeInterpreterSessionsResponses, + type UsageCodeInterpreterSessionsResult, + type UsageCompletionsData, + type UsageCompletionsResponse, + type UsageCompletionsResponses, + type UsageCompletionsResult, + type UsageCostsData, + type UsageCostsResponse, + type UsageCostsResponses, + type UsageEmbeddingsData, + type UsageEmbeddingsResponse, + type UsageEmbeddingsResponses, + type UsageEmbeddingsResult, + type UsageImagesData, + type UsageImagesResponse, + type UsageImagesResponses, + type UsageImagesResult, + type UsageModerationsData, + type UsageModerationsResponse, + type UsageModerationsResponses, + type UsageModerationsResult, + type UsageResponse, + type UsageTimeBucket, + type UsageVectorStoresData, + type UsageVectorStoresResponse, + type UsageVectorStoresResponses, + type UsageVectorStoresResult, + type User, + type UserDeleteResponse, + type UserListResponse, + type UserRoleUpdateRequest, + type VadConfig, + type ValidateGraderData, + type ValidateGraderRequest, + type ValidateGraderResponse, + type ValidateGraderResponse2, + type ValidateGraderResponses, + type VectorStoreExpirationAfter, + type VectorStoreFileAttributes, + type VectorStoreFileBatchObject, + type VectorStoreFileContentResponse, + type VectorStoreFileObject, + type VectorStoreObject, + type VectorStoreSearchRequest, + type VectorStoreSearchResultContentObject, + type VectorStoreSearchResultItem, + type VectorStoreSearchResultsPage, + Verbosity, + type VoiceIdsShared, + type Wait, + type WebhookBatchCancelled, + type WebhookBatchCompleted, + type WebhookBatchExpired, + type WebhookBatchFailed, + type WebhookEvalRunCanceled, + type WebhookEvalRunFailed, + type WebhookEvalRunSucceeded, + type WebhookFineTuningJobCancelled, + type WebhookFineTuningJobFailed, + type WebhookFineTuningJobSucceeded, + type WebhookResponseCancelled, + type WebhookResponseCompleted, + type WebhookResponseFailed, + type WebhookResponseIncomplete, + type Webhooks, + type WebSearchActionFind, + type WebSearchActionOpenPage, + type WebSearchActionSearch, + WebSearchContextSize, + type WebSearchLocation, + type WebSearchPreviewTool, + type WebSearchToolCall, +} from './types.gen'; diff --git a/examples/openapi-ts-openai/src/client/types.gen.ts b/examples/openapi-ts-openai/src/client/types.gen.ts index ac7532f675..154964e7c1 100644 --- a/examples/openapi-ts-openai/src/client/types.gen.ts +++ b/examples/openapi-ts-openai/src/client/types.gen.ts @@ -5404,7 +5404,7 @@ export type Embedding = { object: 'embedding'; }; -export type _Error = { +export type Error = { code: string; message: string; param: string; @@ -5416,11 +5416,11 @@ export type _Error = { */ export type ErrorEvent = { event: 'error'; - data: _Error; + data: Error; }; export type ErrorResponse = { - error: _Error; + error: Error; }; /** @@ -19409,7 +19409,7 @@ export type DeleteEvalErrors = { /** * Evaluation not found. */ - 404: _Error; + 404: Error; }; export type DeleteEvalError = DeleteEvalErrors[keyof DeleteEvalErrors]; @@ -19533,7 +19533,7 @@ export type CreateEvalRunErrors = { /** * Bad request (for example, missing eval object) */ - 400: _Error; + 400: Error; }; export type CreateEvalRunError = CreateEvalRunErrors[keyof CreateEvalRunErrors]; @@ -19568,7 +19568,7 @@ export type DeleteEvalRunErrors = { /** * Run not found */ - 404: _Error; + 404: Error; }; export type DeleteEvalRunError = DeleteEvalRunErrors[keyof DeleteEvalRunErrors]; @@ -22116,7 +22116,7 @@ export type DeleteResponseErrors = { /** * Not Found */ - 404: _Error; + 404: Error; }; export type DeleteResponseError = @@ -22198,7 +22198,7 @@ export type CancelResponseErrors = { /** * Not Found */ - 404: _Error; + 404: Error; }; export type CancelResponseError = diff --git a/examples/openapi-ts-pinia-colada/src/client/@pinia/colada.gen.ts b/examples/openapi-ts-pinia-colada/src/client/@pinia/colada.gen.ts index 921fe1fc42..75aae1970c 100644 --- a/examples/openapi-ts-pinia-colada/src/client/@pinia/colada.gen.ts +++ b/examples/openapi-ts-pinia-colada/src/client/@pinia/colada.gen.ts @@ -63,10 +63,10 @@ import type { export const addPetMutation = ( options?: Partial> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await addPet({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -81,10 +81,10 @@ export const addPetMutation = ( export const updatePetMutation = ( options?: Partial> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await updatePet({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -175,10 +175,10 @@ export const findPetsByTagsQuery = defineQueryOptions((options: Options> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await deletePet({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -210,10 +210,10 @@ export const getPetByIdQuery = defineQueryOptions((options: Options> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await updatePetWithForm({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -228,10 +228,10 @@ export const updatePetWithFormMutation = ( export const uploadFileMutation = ( options?: Partial> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await uploadFile({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -263,10 +263,10 @@ export const getInventoryQuery = defineQueryOptions((options?: Options> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await placeOrder({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -281,10 +281,10 @@ export const placeOrderMutation = ( export const deleteOrderMutation = ( options?: Partial> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await deleteOrder({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -316,10 +316,10 @@ export const getOrderByIdQuery = defineQueryOptions((options: Options> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await createUser({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -338,10 +338,10 @@ export const createUsersWithListInputMutation = ( Options, Error > => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await createUsersWithListInput({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -390,10 +390,10 @@ export const logoutUserQuery = defineQueryOptions((options?: Options> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await deleteUser({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data @@ -425,10 +425,10 @@ export const getUserByNameQuery = defineQueryOptions((options: Options> ): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await updateUser({ ...options, - ...fnOptions, + ...vars, throwOnError: true }) return data diff --git a/examples/openapi-ts-pinia-colada/src/client/index.ts b/examples/openapi-ts-pinia-colada/src/client/index.ts index b190962d22..3da5084b1e 100644 --- a/examples/openapi-ts-pinia-colada/src/client/index.ts +++ b/examples/openapi-ts-pinia-colada/src/client/index.ts @@ -1,5 +1,128 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './@pinia/colada.gen' -export * from './sdk.gen' -export type * from './types.gen' +export { + addPetMutation, + createUserMutation, + createUsersWithListInputMutation, + deleteOrderMutation, + deletePetMutation, + deleteUserMutation, + findPetsByStatusQuery, + findPetsByTagsQuery, + getInventoryQuery, + getOrderByIdQuery, + getPetByIdQuery, + getUserByNameQuery, + loginUserQuery, + logoutUserQuery, + placeOrderMutation, + type QueryKey, + updatePetMutation, + updatePetWithFormMutation, + updateUserMutation, + uploadFileMutation +} from './@pinia/colada.gen' +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile +} from './sdk.gen' +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray +} from './types.gen' diff --git a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/index.ts b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/index.ts index 57ed02bf5f..75b9a8d127 100644 --- a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/index.ts +++ b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-tanstack-react-query/src/client/index.ts b/examples/openapi-ts-tanstack-react-query/src/client/index.ts index 57ed02bf5f..fb2e1d6fcc 100644 --- a/examples/openapi-ts-tanstack-react-query/src/client/index.ts +++ b/examples/openapi-ts-tanstack-react-query/src/client/index.ts @@ -1,4 +1,85 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { type Options, Sdk } from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-tanstack-svelte-query/src/client/index.ts b/examples/openapi-ts-tanstack-svelte-query/src/client/index.ts index 57ed02bf5f..75b9a8d127 100644 --- a/examples/openapi-ts-tanstack-svelte-query/src/client/index.ts +++ b/examples/openapi-ts-tanstack-svelte-query/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export type * from './types.gen'; +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile, +} from './sdk.gen'; +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray, +} from './types.gen'; diff --git a/examples/openapi-ts-tanstack-vue-query/src/client/index.ts b/examples/openapi-ts-tanstack-vue-query/src/client/index.ts index 550b29b773..8e620149f8 100644 --- a/examples/openapi-ts-tanstack-vue-query/src/client/index.ts +++ b/examples/openapi-ts-tanstack-vue-query/src/client/index.ts @@ -1,4 +1,106 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen' -export type * from './types.gen' +export { + addPet, + createUser, + createUsersWithListInput, + deleteOrder, + deletePet, + deleteUser, + findPetsByStatus, + findPetsByTags, + getInventory, + getOrderById, + getPetById, + getUserByName, + loginUser, + logoutUser, + type Options, + placeOrder, + updatePet, + updatePetWithForm, + updateUser, + uploadFile +} from './sdk.gen' +export type { + AddPetData, + AddPetErrors, + AddPetResponse, + AddPetResponses, + ApiResponse, + Category, + ClientOptions, + CreateUserData, + CreateUserErrors, + CreateUserResponse, + CreateUserResponses, + CreateUsersWithListInputData, + CreateUsersWithListInputErrors, + CreateUsersWithListInputResponse, + CreateUsersWithListInputResponses, + DeleteOrderData, + DeleteOrderErrors, + DeleteOrderResponses, + DeletePetData, + DeletePetErrors, + DeletePetResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + FindPetsByStatusData, + FindPetsByStatusErrors, + FindPetsByStatusResponse, + FindPetsByStatusResponses, + FindPetsByTagsData, + FindPetsByTagsErrors, + FindPetsByTagsResponse, + FindPetsByTagsResponses, + GetInventoryData, + GetInventoryErrors, + GetInventoryResponse, + GetInventoryResponses, + GetOrderByIdData, + GetOrderByIdErrors, + GetOrderByIdResponse, + GetOrderByIdResponses, + GetPetByIdData, + GetPetByIdErrors, + GetPetByIdResponse, + GetPetByIdResponses, + GetUserByNameData, + GetUserByNameErrors, + GetUserByNameResponse, + GetUserByNameResponses, + LoginUserData, + LoginUserErrors, + LoginUserResponse, + LoginUserResponses, + LogoutUserData, + LogoutUserErrors, + LogoutUserResponses, + Order, + Pet, + Pet2, + PlaceOrderData, + PlaceOrderErrors, + PlaceOrderResponse, + PlaceOrderResponses, + Tag, + UpdatePetData, + UpdatePetErrors, + UpdatePetResponse, + UpdatePetResponses, + UpdatePetWithFormData, + UpdatePetWithFormErrors, + UpdatePetWithFormResponse, + UpdatePetWithFormResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserResponses, + UploadFileData, + UploadFileErrors, + UploadFileResponse, + UploadFileResponses, + User, + UserArray +} from './types.gen' diff --git a/packages/codegen-core/.gitignore b/packages/codegen-core/.gitignore index 71dbc8c3c2..f163e328eb 100644 --- a/packages/codegen-core/.gitignore +++ b/packages/codegen-core/.gitignore @@ -9,6 +9,7 @@ npm-debug.log* temp yarn-debug.log* yarn-error.log* +*.tsbuildinfo *.iml dist diff --git a/packages/codegen-core/package.json b/packages/codegen-core/package.json index 45ce169240..d579f19f87 100644 --- a/packages/codegen-core/package.json +++ b/packages/codegen-core/package.json @@ -60,6 +60,10 @@ "engines": { "node": ">=20.19.0" }, + "dependencies": { + "ansi-colors": "4.1.3", + "color-support": "1.1.3" + }, "peerDependencies": { "typescript": ">=5.5.3" }, diff --git a/packages/codegen-core/src/__tests__/bimap.test.ts b/packages/codegen-core/src/__tests__/bimap.test.ts deleted file mode 100644 index b28fe2665e..0000000000 --- a/packages/codegen-core/src/__tests__/bimap.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { describe, expect, it } from 'vitest'; - -import { BiMap } from '../bimap/bimap'; - -describe('BiMap', () => { - it('covers the full public interface', () => { - const bimap = new BiMap(); - // set and get - expect(bimap.set(1, 'a')).toBe(bimap); - expect(bimap.set(2, 'b')).toBe(bimap); - // get, getKey - expect(bimap.get(1)).toBe('a'); - expect(bimap.get(2)).toBe('b'); - expect(bimap.getKey('a')).toBe(1); - expect(bimap.getKey('b')).toBe(2); - // hasKey, hasValue - expect(bimap.hasKey(1)).toBe(true); - expect(bimap.hasKey(2)).toBe(true); - expect(bimap.hasKey(3)).toBe(false); - expect(bimap.hasValue('a')).toBe(true); - expect(bimap.hasValue('b')).toBe(true); - expect(bimap.hasValue('c')).toBe(false); - // keys, values, entries - expect(Array.from(bimap.keys())).toEqual([1, 2]); - expect(Array.from(bimap.values())).toEqual(['a', 'b']); - expect(Array.from(bimap.entries())).toEqual([ - [1, 'a'], - [2, 'b'], - ]); - // Symbol.iterator - expect(Array.from(bimap)).toEqual([ - [1, 'a'], - [2, 'b'], - ]); - // size - expect(bimap.size).toBe(2); - // delete by key - expect(bimap.delete(1)).toBe(true); - expect(bimap.hasKey(1)).toBe(false); - expect(bimap.hasValue('a')).toBe(false); - // delete by value - expect(bimap.deleteValue('b')).toBe(true); - expect(bimap.hasKey(2)).toBe(false); - expect(bimap.hasValue('b')).toBe(false); - // After all deletes - expect(bimap.size).toBe(0); - // Setting again to check overwrite - bimap.set(1, 'x'); - bimap.set(2, 'y'); - expect(bimap.get(1)).toBe('x'); - expect(bimap.get(2)).toBe('y'); - // Overwrite value for existing key - bimap.set(1, 'z'); - expect(bimap.get(1)).toBe('z'); - expect(bimap.getKey('z')).toBe(1); - // Overwrite key for existing value - bimap.set(3, 'z'); - expect(bimap.getKey('z')).toBe(3); - expect(bimap.get(1)).toBeUndefined(); - // Iteration after overwrite - expect(Array.from(bimap)).toEqual([ - [2, 'y'], - [3, 'z'], - ]); - }); -}); diff --git a/packages/codegen-core/src/__tests__/bindings.test.ts b/packages/codegen-core/src/__tests__/bindings.test.ts deleted file mode 100644 index 2e21c0c92e..0000000000 --- a/packages/codegen-core/src/__tests__/bindings.test.ts +++ /dev/null @@ -1,230 +0,0 @@ -import { describe, expect, it } from 'vitest'; - -import type { IBiMap } from '../bimap/types'; -import type { IBinding } from '../bindings/types'; -import { createBinding, mergeBindings } from '../bindings/utils'; -import type { ISymbolMeta } from '../extensions/types'; -import type { IFileOut } from '../files/types'; -import type { ISymbolOut } from '../symbols/types'; - -function makeBiMap(entries: [number, string][] = []): IBiMap { - const map = new Map(entries); - const reverse = new Map(entries.map(([k, v]) => [v, k])); - const bimap: IBiMap = { - delete: (key: number) => { - const value = map.get(key); - map.delete(key); - if (value) reverse.delete(value); - return true; - }, - deleteValue: (value: string) => { - const key = reverse.get(value); - reverse.delete(value); - if (key) map.delete(key); - return true; - }, - entries: () => map.entries(), - get: (key: number) => map.get(key), - getKey: (value: string) => reverse.get(value), - hasKey: (key: number) => map.has(key), - hasValue: (value: string) => reverse.has(value), - keys() { - return map.keys(); - }, - set: (key: number, value: string): IBiMap => { - map.set(key, value); - reverse.set(value, key); - return bimap; - }, - size: 0, - values() { - return map.values(); - }, - [Symbol.iterator]() { - return map[Symbol.iterator](); - }, - }; - return bimap; -} - -const makeFile = ( - resolvedNames: IBiMap = makeBiMap(), - id: number = 1, -): IFileOut => ({ - extension: 'ts', - id, - name: '', - path: '', - resolvedNames, - selector: [], - symbols: { body: [], exports: [], imports: [] }, -}); - -const makeSymbol = ( - id: number, - placeholder: string, - meta: ISymbolMeta = {}, - name?: string, -): ISymbolOut => { - const { importKind, kind, ...restMeta } = meta as any; - return { - id, - importKind, - kind, - meta: restMeta, - name, - placeholder, - } as any; -}; - -describe('createBinding', () => { - it('creates a named binding by default', () => { - const file = makeFile(makeBiMap([[1, 'Foo']])); - const symbol = makeSymbol( - 1, - 'Foo', - { importKind: 'named', kind: 'value' }, - 'Foo', - ); - const symbolFile = makeFile(makeBiMap([[1, 'Foo']])); - const binding = createBinding({ - file, - modulePath: './foo', - symbol, - symbolFile, - }); - expect(binding).toEqual({ - aliases: {}, - from: './foo', - names: ['Foo'], - typeNames: [], - }); - }); - - it('creates a default binding', () => { - const file = makeFile(); - const symbol = makeSymbol( - 2, - 'Bar', - { importKind: 'default', kind: 'value' }, - 'Bar', - ); - const symbolFile = makeFile(); - const binding = createBinding({ - file, - modulePath: './bar', - symbol, - symbolFile, - }); - expect(binding).toEqual({ - aliases: {}, - defaultBinding: 'Bar', - from: './bar', - names: [], - typeDefaultBinding: undefined, - typeNames: [], - }); - }); - - it('creates a namespace binding', () => { - const file = makeFile(); - const symbol = makeSymbol( - 3, - 'Baz', - { importKind: 'namespace', kind: 'value' }, - 'Baz', - ); - const symbolFile = makeFile(); - const binding = createBinding({ - file, - modulePath: './baz', - symbol, - symbolFile, - }); - expect(binding).toEqual({ - aliases: {}, - from: './baz', - names: [], - namespaceBinding: 'Baz', - typeNames: [], - typeNamespaceBinding: undefined, - }); - }); - - it('creates type names for type symbols', () => { - const file = makeFile(makeBiMap([[4, 'Qux']])); - const symbol = makeSymbol( - 4, - 'Qux', - { importKind: 'named', kind: 'type' }, - 'Qux', - ); - const symbolFile = makeFile(makeBiMap([[4, 'Qux']])); - const binding = createBinding({ - file, - modulePath: './qux', - symbol, - symbolFile, - }); - expect(binding).toEqual({ - aliases: {}, - from: './qux', - names: ['Qux'], - typeNames: ['Qux'], - }); - }); -}); - -describe('mergeBindings', () => { - it('merges aliases, names, and typeNames', () => { - const target: IBinding = { - aliases: { Foo: 'Bar' }, - from: './foo', - names: ['Foo'], - typeNames: ['Foo'], - }; - const source: IBinding = { - aliases: { Baz: 'Qux' }, - from: './foo', - names: ['Baz'], - typeNames: ['Baz'], - }; - mergeBindings(target, source); - expect(target).toEqual({ - aliases: { Baz: 'Qux', Foo: 'Bar' }, - from: './foo', - names: ['Foo', 'Baz'], - typeNames: ['Foo', 'Baz'], - }); - }); - - it('merges default and namespace bindings', () => { - const target: IBinding = { - aliases: {}, - from: './foo', - names: [], - typeNames: [], - }; - const source: IBinding = { - aliases: {}, - defaultBinding: 'Default', - from: './foo', - names: [], - namespaceBinding: 'NS', - typeDefaultBinding: true, - typeNames: [], - typeNamespaceBinding: true, - }; - mergeBindings(target, source); - expect(target).toEqual({ - aliases: {}, - defaultBinding: 'Default', - from: './foo', - names: [], - namespaceBinding: 'NS', - typeDefaultBinding: true, - typeNames: [], - typeNamespaceBinding: true, - }); - }); -}); diff --git a/packages/codegen-core/src/__tests__/exports.test.ts b/packages/codegen-core/src/__tests__/exports.test.ts index 6d97ef1fa6..94aa02c713 100644 --- a/packages/codegen-core/src/__tests__/exports.test.ts +++ b/packages/codegen-core/src/__tests__/exports.test.ts @@ -2,23 +2,57 @@ import { describe, expect, it } from 'vitest'; import * as index from '../index'; -const constExports = ['createBinding', 'mergeBindings', 'Project', 'renderIds']; +const constExports = [ + 'debug', + 'defaultExtensions', + 'defaultNameConflictResolvers', + 'File', + 'fromRef', + 'fromRefs', + 'isNode', + 'isNodeRef', + 'isRef', + 'isSymbol', + 'isSymbolRef', + 'nodeBrand', + 'Project', + 'ref', + 'refs', + 'simpleNameConflictResolver', + 'Symbol', + 'symbolBrand', + 'underscoreNameConflictResolver', +]; // Type-level test: will fail to compile if any type export is missing or renamed export type _TypeExports = [ - index.BiMap, - index.Binding, - index.ProjectRenderMeta, - index.SymbolMeta, + index.AnalysisContext, + index.BindingKind, + index.ExportMember, + index.ExportModule, + index.Extensions, index.File, - index.FileIdentifier, index.FileIn, - index.Output, + index.FromRef, + index.FromRefs, index.IProject, + index.ImportMember, + index.ImportModule, + index.Language, + index.NameConflictResolver, + index.NameConflictResolvers, + index.Node, + index.Output, + index.Project, + index.ProjectRenderMeta, + index.Ref, + index.Refs, + index.RenderContext, index.Renderer, index.Symbol, index.SymbolIdentifier, index.SymbolIn, + index.SymbolMeta, ]; describe('index exports', () => { diff --git a/packages/codegen-core/src/__tests__/files.test.ts b/packages/codegen-core/src/__tests__/files.test.ts index ef376d1a10..2186eeed4f 100644 --- a/packages/codegen-core/src/__tests__/files.test.ts +++ b/packages/codegen-core/src/__tests__/files.test.ts @@ -1,109 +1,131 @@ import { describe, expect, it } from 'vitest'; +import { File } from '../files/file'; import { FileRegistry } from '../files/registry'; +const mockProject = {} as any; + describe('FileRegistry', () => { - it('covers the full public interface', () => { - const registry = new FileRegistry(); - // id property increments - const id1 = registry.id; - const id2 = registry.id; - expect(typeof id1).toBe('number'); - expect(id2).toBe(id1 + 1); - - // Register a file with selector - const file1 = registry.register({ name: 'Foo', selector: ['foo'] }); - expect(file1).toEqual({ - extension: undefined, - external: undefined, - id: expect.any(Number), - name: 'Foo', - path: undefined, - resolvedNames: expect.any(Object), - selector: ['foo'], - symbols: { body: [], exports: [], imports: [] }, + it('register() creates a new File with incrementing id', () => { + const registry = new FileRegistry(mockProject); + + const f1 = registry.register({ + language: 'typescript', + logicalFilePath: 'foo.ts', + }); + const f2 = registry.register({ + language: 'typescript', + logicalFilePath: 'bar.ts', + }); + + expect(f1).toBeInstanceOf(File); + expect(f2).toBeInstanceOf(File); + expect(f2.id).toBe(f1.id + 1); + }); + + it('register() updates name if file already exists', () => { + const registry = new FileRegistry(mockProject); + + const f1 = registry.register({ + language: 'typescript', + logicalFilePath: 'dup.ts', + name: 'First', + }); + const f2 = registry.register({ + language: 'typescript', + logicalFilePath: 'dup.ts', + name: 'Second', }); - // get by id and selector - expect(registry.get(file1.id)).toEqual(file1); - expect(registry.get(['foo'])).toEqual(file1); + expect(f1).toBe(f2); // same File instance + expect(f1.name).toBe('Second'); // name updated + }); - // isRegistered should be true for explicitly registered files - expect(registry.isRegistered(file1.id)).toBe(true); - expect(registry.isRegistered(['foo'])).toBe(true); + it('get() returns the registered File or undefined', () => { + const registry = new FileRegistry(mockProject); - // Registering again with same selector returns same file - const file1b = registry.register({ selector: ['foo'] }); - expect(file1b).toEqual(file1); + const f = registry.register({ language: 'ts', logicalFilePath: 'get.ts' }); - // Registering with id returns same file - const file1c = registry.register({ id: file1.id }); - expect(file1c).toEqual(file1); + expect(registry.get({ language: 'ts', logicalFilePath: 'get.ts' })).toBe(f); + expect( + registry.get({ language: 'ts', logicalFilePath: 'missing.ts' }), + ).toBeUndefined(); + }); - // Reference by id returns same file - const ref1 = registry.reference(file1.id); - expect(ref1).toEqual(file1); + it('isRegistered() returns true only for existing files', () => { + const registry = new FileRegistry(mockProject); - // Reference by selector returns same file - const ref1b = registry.reference(['foo']); - expect(ref1b).toEqual(file1); + registry.register({ language: 'ts', logicalFilePath: 'check.ts' }); - // Register a new file with a different selector - const file2 = registry.register({ - name: 'Bar', - path: '/bar', - selector: ['bar'], + expect( + registry.isRegistered({ language: 'ts', logicalFilePath: 'check.ts' }), + ).toBe(true); + expect( + registry.isRegistered({ language: 'ts', logicalFilePath: 'other.ts' }), + ).toBe(false); + }); + + it('registered() iterates over all files', () => { + const registry = new FileRegistry(mockProject); + + const files = [ + registry.register({ language: 'ts', logicalFilePath: 'a.ts' }), + registry.register({ language: 'ts', logicalFilePath: 'b.ts' }), + ]; + + const iterated = [...registry.registered()]; + expect(iterated).toEqual(files); + }); + + it('handles external flag in key generation', () => { + const registry = new FileRegistry(mockProject); + + const f1 = registry.register({ + external: true, + language: 'ts', + logicalFilePath: 'ext.ts', }); - expect(file2).toEqual({ - extension: undefined, - external: undefined, - id: expect.any(Number), - name: 'Bar', - path: '/bar', - resolvedNames: expect.any(Object), - selector: ['bar'], - symbols: { body: [], exports: [], imports: [] }, + const f2 = registry.register({ + external: false, + language: 'ts', + logicalFilePath: 'ext.ts', }); - // Registered files are yielded in order - const registered = Array.from(registry.registered()); - expect(registered).toEqual([ - expect.objectContaining({ selector: ['foo'] }), - expect.objectContaining({ selector: ['bar'] }), - ]); - - // Referenced files are yielded in order - // Only files referenced but not registered are included - // Reference a new file (not registered) - const file3 = registry.reference(['baz']); - const referenced = Array.from(registry.referenced()); - expect(referenced).toContainEqual(file3); - // Once registered, file1 is not in referenced set - expect(referenced).not.toContainEqual(file1); - - // Referenced-only file should not be considered registered - expect(registry.isRegistered(file3.id)).toBe(false); - // Once registered, file3 becomes registered and no longer appears in referenced() - const file3Registered = registry.register({ - name: 'Baz', - selector: ['baz'], - }); - expect(registry.isRegistered(file3Registered.id)).toBe(true); - const referencedAfter = Array.from(registry.referenced()); - expect(referencedAfter).not.toContainEqual(file3Registered); + expect(f1).not.toBe(f2); + expect( + registry.isRegistered({ + external: true, + language: 'ts', + logicalFilePath: 'ext.ts', + }), + ).toBe(true); + expect( + registry.isRegistered({ + external: false, + language: 'ts', + logicalFilePath: 'ext.ts', + }), + ).toBe(true); }); - it('throws on invalid register or reference', () => { - const registry = new FileRegistry(); - // Register with id that does not exist - expect(() => registry.register({ id: 9999 })).toThrow( - 'File with ID 9999 not found. To register a new file, leave the ID undefined.', - ); - // Register with selector that maps to missing id - // Simulate by manually setting selectorToId - registry['selectorToId'].set(JSON.stringify(['missing']), 42); - expect(() => registry.register({ selector: ['missing'] })).toThrow( - 'File with ID 42 not found. The selector ["missing"] matched an ID, but there was no result. This is likely an issue with the application logic.', - ); + it('language influences key generation', () => { + const registry = new FileRegistry(mockProject); + + const tsFile = registry.register({ + language: 'ts', + logicalFilePath: 'file', + }); + const jsFile = registry.register({ + language: 'js', + logicalFilePath: 'file', + }); + + expect(tsFile).not.toBe(jsFile); + expect( + registry.isRegistered({ language: 'ts', logicalFilePath: 'file' }), + ).toBe(true); + expect( + registry.isRegistered({ language: 'js', logicalFilePath: 'file' }), + ).toBe(true); }); }); diff --git a/packages/codegen-core/src/__tests__/project.test.ts b/packages/codegen-core/src/__tests__/project.test.ts index 53e95e82c1..485f9e5d64 100644 --- a/packages/codegen-core/src/__tests__/project.test.ts +++ b/packages/codegen-core/src/__tests__/project.test.ts @@ -1,90 +1,56 @@ -import { describe, expect, it } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; -import type { IFileOut } from '../files/types'; import { Project } from '../project/project'; -import type { IRenderer } from '../renderer/types'; + +// Mock Planner so we control what files appear in project.files +vi.mock('../planner/planner', () => ({ + Planner: vi.fn().mockImplementation((project) => ({ + plan: vi.fn(() => { + // planner is responsible for creating files + const file = project.files.register({ + logicalFilePath: 'root/a', + }); + file.setFinalPath('/root/a.ts'); + file.setRenderer({ + render: vi.fn(() => 'RENDERED'), + supports: () => true, + }); + }), + })), +})); describe('Project', () => { - it('covers the full public interface', () => { - const renderer: IRenderer = { - renderFile: (content: string) => `RENDERED:${content}`, - renderSymbols: (file: IFileOut) => `SYMBOLS:${file.name}`, - }; - const project = new Project({ - defaultFileName: 'main', - renderers: { '.ts': renderer }, + const makeProject = (overrides: any = {}) => + new Project({ + renderers: [], root: '/root', + ...overrides, }); - // Registries are defined - expect(project.files).toBeDefined(); - expect(project.symbols).toBeDefined(); + it('calls Planner.plan() before rendering', () => { + const p = makeProject(); + p.render(); + }); - // Add a symbol and render output - const symbol = project.symbols.register({ - getFilePath: () => 'foo', - meta: { foo: 'bar' }, - placeholder: 'Foo', - }); - // Add a renderer for .ts files - // Simulate a file with .ts extension - project.files.register({ - extension: '.ts', - name: 'foo', - path: '/root/foo.ts', - selector: ['foo'], - }); - // Render output - const outputs = project.render(); - expect(Array.isArray(outputs)).toBe(true); - expect(outputs.length).toBe(1); - expect(outputs).toEqual([ - { - content: 'RENDERED:SYMBOLS:foo', - path: '/root/foo.ts', - }, - ]); + it('renders files created by the planner', () => { + const p = makeProject(); - // symbolIdToFiles returns correct files - const filesForSymbol = project.symbolIdToFiles(symbol.id); - expect(filesForSymbol.length).toBeGreaterThan(0); - expect(filesForSymbol[0]?.name).toBe('foo'); - }); + const out = p.render(); - it('skips files with no renderer or external', () => { - const project = new Project({ - defaultFileName: 'main', - renderers: {}, - root: '/root', - }); - // Register a file with no extension - project.files.register({ name: 'noext', selector: ['noext'] }); - // Register an external file - project.files.register({ external: true, name: 'ext', selector: ['ext'] }); - // Should not throw, but output should be empty - const outputs = project.render(); - expect(outputs).toEqual([]); + expect(out).toEqual([{ content: 'RENDERED', path: '/root/a.ts' }]); }); - it('respects fileName override', () => { - const renderer: IRenderer = { - renderFile: (content: string) => content, - renderSymbols: (file: IFileOut) => `SYMBOLS:${file.name}`, - }; - const project = new Project({ - defaultFileName: 'main', - fileName: (name) => `X_${name}`, - renderers: { '.ts': renderer }, - root: '/root', - }); - // Register a symbol with selector - project.symbols.register({ - getFilePath: () => 'bar', - meta: { bar: 'baz' }, - placeholder: 'Bar', + it('passes correct ctx to renderer.render()', () => { + const p = makeProject(); + p.render({ hello: true }); + + const file = [...p.files.registered()][0]!; + const renderer = file.renderer!; + + expect(renderer.render).toHaveBeenCalledWith({ + file, + meta: { hello: true }, + project: p, }); - // Render output (should use fileName override) - const outputs = project.render(); - expect(outputs[0]?.path).toContain('X_bar'); }); }); diff --git a/packages/codegen-core/src/__tests__/refs.test.ts b/packages/codegen-core/src/__tests__/refs.test.ts new file mode 100644 index 0000000000..4b3aab60c9 --- /dev/null +++ b/packages/codegen-core/src/__tests__/refs.test.ts @@ -0,0 +1,93 @@ +import { describe, expect, it } from 'vitest'; + +import { fromRef, fromRefs, ref, refs } from '../refs/refs'; +import type { Refs } from '../refs/types'; + +describe('ref', () => { + it('wraps a primitive value', () => { + expect(ref(42)).toEqual({ '~ref': 42 }); + expect(ref('x')).toEqual({ '~ref': 'x' }); + }); + + it('wraps an object', () => { + const obj = { foo: 1 }; + expect(ref(obj)).toEqual({ '~ref': obj }); + }); +}); + +describe('fromRef', () => { + it('unwraps a primitive value', () => { + expect(fromRef({ '~ref': 42 })).toBe(42); + expect(fromRef({ '~ref': 'x' })).toBe('x'); + }); + + it('unwraps an object', () => { + const obj = { foo: 1 }; + expect(fromRef({ '~ref': obj })).toBe(obj); + }); +}); + +describe('ref <-> fromRef roundtrip', () => { + it('roundtrips value -> ref -> value', () => { + expect(fromRef(ref(123))).toBe(123); + const obj = { foo: 'bar' }; + expect(fromRef(ref(obj))).toBe(obj); + }); +}); + +describe('refs', () => { + it('wraps primitives', () => { + expect(refs({ a: 1, b: 'x' })).toEqual({ + a: { '~ref': 1 }, + b: { '~ref': 'x' }, + }); + }); + + it('wraps empty object', () => { + expect(refs({})).toEqual({}); + }); + + it('wraps nested objects shallowly', () => { + const input = { a: { foo: 1 }, b: [1, 2] }; + const value = refs(input); + expect(value.a['~ref']).toEqual({ foo: 1 }); + expect(value.b['~ref']).toEqual([1, 2]); + }); +}); + +describe('fromRefs', () => { + it('unwraps primitives', () => { + expect(fromRefs({ a: { '~ref': 1 }, b: { '~ref': 'x' } })).toEqual({ + a: 1, + b: 'x', + }); + }); + + it('unwraps empty object', () => { + expect(fromRefs({})).toEqual({}); + }); + + it('unwraps nested objects shallowly', () => { + const input: Refs = { + a: { '~ref': { foo: 1 } }, + b: { '~ref': [1, 2] }, + }; + expect(fromRefs(input)).toEqual({ a: { foo: 1 }, b: [1, 2] }); + }); +}); + +describe('refs <-> fromRefs roundtrip', () => { + it('roundtrips plain -> refs -> plain', () => { + const obj = { a: 1, b: 'x', c: [1, 2], d: { foo: 2 } }; + expect(fromRefs(refs(obj))).toEqual(obj); + }); + + it('roundtrips refs -> plain -> refs', () => { + const value: Refs = { + a: { '~ref': 1 }, + b: { '~ref': 'x' }, + c: { '~ref': [1, 2] }, + }; + expect(refs(fromRefs(value))).toEqual(value); + }); +}); diff --git a/packages/codegen-core/src/__tests__/renderer.test.ts b/packages/codegen-core/src/__tests__/renderer.test.ts deleted file mode 100644 index 48559e13b4..0000000000 --- a/packages/codegen-core/src/__tests__/renderer.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; - -import { describe, expect, it } from 'vitest'; - -import { renderIds, wrapId } from '../renderer/utils'; - -describe('renderIds', () => { - it('replaces ids with names', () => { - const source = fs.readFileSync(path.resolve(__dirname, 'data', 'file.ts'), { - encoding: 'utf8', - }); - - const substitutions: Record = { - 1: 'Foo', - 12: 'baz', - 2: 'bar', - 4: 'Bar', - 5: 'Foo', - }; - - const replaced = renderIds(source, (id) => substitutions[id]); - - expect(replaced).toEqual(`/* @ts-nocheck */ - -type Foo = string; -type Bar = () => Foo; - -/** - * something about Foo. Did you know that _Foo_? - */ -export class Foo { - // Foo is great! - bar(baz: ReturnType): Foo { - return baz; - } -} -`); - }); -}); - -describe('wrapId', () => { - it('wraps id in the expected format', () => { - expect(wrapId(String(42))).toBe('_heyapi_42_'); - expect(wrapId(String(0))).toBe('_heyapi_0_'); - expect(wrapId(String(123456))).toBe('_heyapi_123456_'); - expect(wrapId('foo')).toBe('_heyapi_foo_'); - }); -}); diff --git a/packages/codegen-core/src/__tests__/symbols.test.ts b/packages/codegen-core/src/__tests__/symbols.test.ts index 6a1edc28dc..72c658688d 100644 --- a/packages/codegen-core/src/__tests__/symbols.test.ts +++ b/packages/codegen-core/src/__tests__/symbols.test.ts @@ -1,252 +1,111 @@ import { describe, expect, it } from 'vitest'; import { SymbolRegistry } from '../symbols/registry'; +import { Symbol } from '../symbols/symbol'; -describe('SymbolRegistry', () => { - it('covers the full public interface', () => { - const registry = new SymbolRegistry(); - // id property increments - const id1 = registry.id; - const id2 = registry.id; - expect(typeof id1).toBe('number'); - expect(id2).toBe(id1 + 1); - - // Register a symbol with meta - const symbol1 = registry.register({ - meta: { - foo: 'bar', - }, - placeholder: 'Foo', - }); - expect(symbol1).toEqual({ - id: expect.any(Number), - meta: { - foo: 'bar', - }, - placeholder: 'Foo', - }); +const meta = (m: any) => m as any; - // get by id and meta - expect(registry.get(symbol1.id)).toEqual(symbol1); - expect(registry.get({ foo: 'bar' })).toEqual(symbol1); - - // isRegistered should be true for explicitly registered symbols - expect(registry.isRegistered(symbol1.id)).toBe(true); - expect(registry.isRegistered({ foo: 'bar' })).toBe(true); +describe('SymbolRegistry', () => { + it('register() assigns increasing IDs and stores symbols', () => { + const r = new SymbolRegistry(); - // Registering again with same meta creates a new symbol - const symbol1b = registry.register({ meta: { foo: 'bar' } }); - expect(symbol1b).not.toEqual(symbol1); + const a = r.register({ meta: meta({ kind: 'x' }), name: 'A' }); + const b = r.register({ meta: meta({ kind: 'y' }), name: 'B' }); - // Registering with id overrides the symbol - const symbol1c = registry.register({ id: symbol1.id }); - expect(symbol1c).not.toEqual(symbol1); - expect(symbol1c.id).toBe(symbol1.id); + expect(a.id).toBe(0); + expect(b.id).toBe(1); + expect(r.get(0)).toBe(a); + expect(r.get(1)).toBe(b); + }); - // Reference returns same symbol - const ref1 = registry.reference({ foo: 'bar' }); - expect(ref1).toEqual(symbol1c); + it('query() returns symbols matching meta', () => { + const r = new SymbolRegistry(); - // Register a new symbol with different meta - const symbol2 = registry.register({ - exportFrom: ['x'], - meta: { bar: 'baz' }, - placeholder: 'Bar', - }); - expect(symbol2).toEqual({ - exportFrom: ['x'], - id: expect.any(Number), - meta: { bar: 'baz' }, - placeholder: 'Bar', + const a = r.register({ + meta: meta({ nested: { x: 1 }, type: 'foo' }), + name: 'A', }); + r.register({ meta: meta({ type: 'bar' }), name: 'B' }); - // Registered symbols are yielded in order - const registered = Array.from(registry.registered()); - expect(registered).toEqual([ - expect.objectContaining({ id: 2 }), - expect.objectContaining({ meta: { foo: 'bar' } }), - expect.objectContaining({ meta: { bar: 'baz' } }), - ]); - - // setValue, getValue, hasValue - expect(registry.hasValue(symbol1.id)).toBe(false); - registry.setValue(symbol1.id, 42); - expect(registry.hasValue(symbol1.id)).toBe(true); - expect(registry.getValue(symbol1.id)).toBe(42); - - // referenced-only symbol should not be registered until register() - const symRef = registry.reference({ qux: true }); - expect(registry.isRegistered(symRef.id)).toBe(false); - const symRegistered = registry.register({ - meta: { qux: true }, - placeholder: 'Qux', - }); - expect(registry.isRegistered(symRegistered.id)).toBe(true); + const results = r.query(meta({ nested: { x: 1 }, type: 'foo' })); + expect(results).toEqual([a]); }); - it('indexes symbols and supports querying by meta', () => { - const registry = new SymbolRegistry(); + it('query() returns empty array when no matches', () => { + const r = new SymbolRegistry(); + r.register({ meta: meta({ type: 'x' }), name: 'A' }); - // register a couple of symbols with meta - const symA = registry.register({ - meta: { bar: 'type', foo: { bar: true } }, - name: 'A', - }); - const symB = registry.register({ - meta: { bar: 'value', foo: { bar: false } }, - name: 'B', - }); + expect(r.query(meta({ type: 'nope' }))).toEqual([]); + }); - // query by top-level meta key - const types = registry.query({ bar: 'type' }); - expect(types).toEqual([symA]); + it('reference() returns stub if not registered', () => { + const r = new SymbolRegistry(); + const stub = r.reference(meta({ id: 1, kind: 'x' })); - // query by nested meta key - const nestedTrue = registry.query({ foo: { bar: true } }); - expect(nestedTrue).toEqual([symA]); + expect(stub).toBeInstanceOf(Symbol); + expect(r.isRegistered(stub.id)).toBe(false); - const nestedFalse = registry.query({ foo: { bar: false } }); - expect(nestedFalse).toEqual([symB]); + // same meta → same stub + const again = r.reference(meta({ id: 1, kind: 'x' })); + expect(again).toBe(stub); }); - it('replaces stubs after registering', () => { - const registry = new SymbolRegistry(); + it('reference() stub is replaced when real symbol registers', () => { + const r = new SymbolRegistry(); - const refA = registry.reference({ a: 0 }); - const refAB = registry.reference({ a: 0, b: 0 }); - const refB = registry.reference({ b: -1 }); - const symC = registry.register({ - meta: { a: 0, b: 0, c: 0 }, - name: 'C', + const stub = r.reference(meta({ group: 'abc', tag: 1 })); + const real = r.register({ + meta: meta({ group: 'abc', tag: 1 }), + name: 'Real', }); - const refAD = registry.reference({ a: 0, d: 0 }); - const refAC = registry.reference({ a: 0, c: 0 }); - - expect(symC).toEqual(refA); - expect(symC).toEqual(refAB); - expect(symC).toEqual(refAC); - expect(symC).not.toEqual(refAD); - expect(symC).not.toEqual(refB); - expect(symC.meta).toEqual({ a: 0, b: 0, c: 0 }); - }); - it('caches query results and invalidates on relevant updates', () => { - const registry = new SymbolRegistry(); - const symA = registry.register({ meta: { foo: 'bar' }, name: 'A' }); + // Stub should now canonicalize to the real one + expect(stub.canonical).toBe(real); + expect(r.get(stub.id)).toBe(stub); - // first query populates cache - const result1 = registry.query({ foo: 'bar' }); - expect(result1).toEqual([symA]); - expect(registry['queryCache'].size).toBe(1); - - // same query should hit cache, no change in cache size - const result2 = registry.query({ foo: 'bar' }); - expect(result2).toEqual([symA]); - expect(registry['queryCache'].size).toBe(1); + // Queries should now return the real one + expect(r.query(meta({ group: 'abc', tag: 1 }))).toEqual([real]); + }); - // register another symbol with matching key should invalidate cache - registry.register({ meta: { foo: 'bar' }, name: 'B' }); - expect(registry['queryCache'].size).toBe(0); + it('isRegistered() returns true only for registered symbols', () => { + const r = new SymbolRegistry(); + const stub = r.reference(meta({ foo: 1 })); + const real = r.register({ meta: meta({ foo: 1 }), name: 'X' }); - // new query repopulates cache - const result3 = registry.query({ foo: 'bar' }); - expect(result3.map((r) => r.name).sort()).toEqual(['A', 'B']); - expect(registry['queryCache'].size).toBe(1); + expect(r.isRegistered(stub.id)).toBe(false); + expect(r.isRegistered(real.id)).toBe(true); }); - it('invalidates only affected cache entries', () => { - const registry = new SymbolRegistry(); - const symA = registry.register({ meta: { foo: 'bar' }, name: 'A' }); - const symX = registry.register({ meta: { x: 'y' }, name: 'X' }); - - // Seed multiple cache entries - const resultFoo = registry.query({ foo: 'bar' }); - const resultX = registry.query({ x: 'y' }); - expect(resultFoo).toEqual([symA]); - expect(resultX).toEqual([symX]); - const initialCacheKeys = Array.from(registry['queryCache'].keys()); - expect(initialCacheKeys.length).toBe(2); - - // Add new symbol that should only affect foo:bar queries - registry.register({ meta: { foo: 'bar' }, name: 'B' }); - - // Cache entry for foo:bar should be invalidated, x:y should remain - const cacheKeysAfter = Array.from(registry['queryCache'].keys()); - expect(cacheKeysAfter.length).toBe(1); - const remainingKey = cacheKeysAfter[0]; - expect(remainingKey).toBe( - initialCacheKeys.find((k) => k.includes('x:"y"')), - ); - - // Query foo:bar again to repopulate it - const resultFoo2 = registry.query({ foo: 'bar' }); - expect(resultFoo2.map((r) => r.name).sort()).toEqual(['A', 'B']); - expect(registry['queryCache'].size).toBe(2); - }); + it('registered() iterates over only registered symbols (not stubs)', () => { + const r = new SymbolRegistry(); + r.reference(meta({ x: 1 })); // stub + const a = r.register({ meta: meta({ x: 2 }), name: 'A' }); + const b = r.register({ meta: meta({ x: 3 }), name: 'B' }); - it('caches empty results across all early exit paths', () => { - const registry = new SymbolRegistry(); - - // 1. Key doesn't exist in indices - const resNoKey = registry.query({ foo: 'bar' }); - expect(resNoKey).toEqual([]); - const cacheKeys1 = Array.from(registry['queryCache'].keys()); - expect(cacheKeys1.length).toBe(1); - expect(registry['queryCache'].get(cacheKeys1[0]!)).toEqual([]); - - // 2. Key exists but value doesn't - // Insert symbol with unrelated meta - registry.register({ meta: { something: 'else' }, name: 'A' }); - const resNoValue = registry.query({ bar: 'baz' }); - expect(resNoValue).toEqual([]); - const cacheKeys2 = Array.from(registry['queryCache'].keys()); - expect(cacheKeys2.length).toBe(2); - expect(registry['queryCache'].get(cacheKeys2[1]!)).toEqual([]); - - // 3. Empty indexKeySpace (empty meta object) - const resEmpty = registry.query({}); - expect(resEmpty).toEqual([]); - const cacheKeys3 = Array.from(registry['queryCache'].keys()); - expect(cacheKeys3.length).toBe(3); - expect(registry['queryCache'].get(cacheKeys3[2]!)).toEqual([]); + expect([...r.registered()]).toEqual([a, b]); }); - it('returns the same stub reference for identical unresolved meta', () => { - const registry = new SymbolRegistry(); + it('cache invalidates when new symbol matches cached query', () => { + const r = new SymbolRegistry(); - const stubA1 = registry.reference({ a: 1 }); - const stubA2 = registry.reference({ a: 1 }); + // prime cache + expect(r.query(meta({ type: 'foo' }))).toEqual([]); - // Same reference, not new instance - expect(stubA1).toBe(stubA2); + const a = r.register({ meta: meta({ type: 'foo' }), name: 'A' }); - // Cache entry created by the internal query call - const cacheKey = registry['buildCacheKey']({ a: 1 }); - expect(registry['queryCache'].has(cacheKey)).toBe(true); - expect(registry['queryCache'].get(cacheKey)).toEqual([]); + // now query again → cache should be invalidated → return new entry + expect(r.query(meta({ type: 'foo' }))).toEqual([a]); }); - it('demonstrates stub addition does not invalidate unrelated cache', () => { - const registry = new SymbolRegistry(); - - // Create one indexed symbol and one query to seed cache - const symA = registry.register({ meta: { foo: 'bar' }, name: 'A' }); - const resultFoo = registry.query({ foo: 'bar' }); - expect(resultFoo).toEqual([symA]); - const cacheKeysBefore = Array.from(registry['queryCache'].keys()); - expect(cacheKeysBefore.length).toBe(1); - - // Add unrelated stub (its meta triggers its own query) - const stub = registry.reference({ something: 'else' }); - expect(stub.meta).toEqual({ something: 'else' }); + it('nested meta keys are indexed correctly', () => { + const r = new SymbolRegistry(); - // Existing cache entry still present, plus one new entry for stub - const cacheKeysAfter = Array.from(registry['queryCache'].keys()); - expect(cacheKeysAfter.length).toBe(cacheKeysBefore.length + 1); - expect(cacheKeysAfter).toEqual(expect.arrayContaining(cacheKeysBefore)); + const a = r.register({ + meta: meta({ a: { b: { c: 123 } } }), + name: 'A', + }); - // The new stub isn't indexed, so query returns nothing yet - const newQuery = registry.query({ something: 'else' }); - expect(newQuery).toEqual([]); + const result = r.query(meta({ a: { b: { c: 123 } } })); + expect(result).toEqual([a]); }); }); diff --git a/packages/codegen-core/src/bimap/bimap.ts b/packages/codegen-core/src/bimap/bimap.ts deleted file mode 100644 index 93f21afb96..0000000000 --- a/packages/codegen-core/src/bimap/bimap.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type { IBiMap } from './types'; - -export class BiMap implements IBiMap { - private map = new Map(); - private reverse = new Map(); - - delete(key: Key): boolean { - const value = this.map.get(key); - if (value !== undefined) { - this.reverse.delete(value); - } - return this.map.delete(key); - } - - deleteValue(value: Value): boolean { - const key = this.reverse.get(value); - if (key !== undefined) { - this.map.delete(key); - } - return this.reverse.delete(value); - } - - entries(): IterableIterator<[Key, Value]> { - return this.map.entries(); - } - - get(key: Key): Value | undefined { - return this.map.get(key); - } - - getKey(value: Value): Key | undefined { - return this.reverse.get(value); - } - - hasKey(key: Key): boolean { - return this.map.has(key); - } - - hasValue(value: Value): boolean { - return this.reverse.has(value); - } - - keys(): IterableIterator { - return this.map.keys(); - } - - set(key: Key, value: Value): this { - const oldValue = this.map.get(key); - if (oldValue !== undefined && oldValue !== value) { - this.reverse.delete(oldValue); - } - const oldKey = this.reverse.get(value); - if (oldKey !== undefined && oldKey !== key) { - this.map.delete(oldKey); - } - this.map.set(key, value); - this.reverse.set(value, key); - return this; - } - - get size(): number { - return this.map.size; - } - - values(): IterableIterator { - return this.map.values(); - } - - [Symbol.iterator](): IterableIterator<[Key, Value]> { - return this.map[Symbol.iterator](); - } -} diff --git a/packages/codegen-core/src/bimap/types.d.ts b/packages/codegen-core/src/bimap/types.d.ts deleted file mode 100644 index c7b81aea3c..0000000000 --- a/packages/codegen-core/src/bimap/types.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Bi-directional map interface. - * - * Keys map to values and values map back to keys. - * - * @template Key Type of the map keys - * @template Value Type of the map values - */ -export interface IBiMap { - /** - * Deletes a key and its associated value from the map. - * - * @param key The key to delete. - */ - delete(key: Key): boolean; - /** - * Deletes a value and its associated key from the map. - * - * @param value The value to delete. - */ - deleteValue(value: Value): boolean; - /** - * Returns an iterator of [key, value] pairs. - */ - entries(): IterableIterator<[Key, Value]>; - /** - * Gets the value associated with a key. - * - * @param key The key to look up. - */ - get(key: Key): Value | undefined; - /** - * Gets the key associated with a value. - * - * @param value The value to look up. - */ - getKey(value: Value): Key | undefined; - /** - * Checks if a key exists in the map. - * - * @param key The key to check. - */ - hasKey(key: Key): boolean; - /** - * Checks if a value exists in the map. - * - * @param value The value to check. - */ - hasValue(value: Value): boolean; - /** - * Returns an iterator of keys. - */ - keys(): IterableIterator; - /** - * Sets a key-value pair in the map. - * - * @param key The key. - * @param value The value. - * @returns This instance for chaining. - */ - set(key: Key, value: Value): this; - /** - * Number of key-value pairs in the map. - */ - readonly size: number; - /** - * Returns an iterator of values. - */ - values(): IterableIterator; - /** - * Enables iteration with `for...of`. - */ - [Symbol.iterator](): IterableIterator<[Key, Value]>; -} diff --git a/packages/codegen-core/src/bindings.d.ts b/packages/codegen-core/src/bindings.d.ts new file mode 100644 index 0000000000..27f6396066 --- /dev/null +++ b/packages/codegen-core/src/bindings.d.ts @@ -0,0 +1,57 @@ +import type { File } from './files/file'; +import type { BindingKind } from './symbols/types'; + +export interface ExportMember { + /** + * Name under which the symbol is exported in this file. + * + * export { Foo as Bar } from "./models" + * + * exportedName === "Bar" + */ + exportedName: string; + /** Whether this export is type-only. */ + isTypeOnly: boolean; + /** Export flavor. */ + kind: BindingKind; + /** The exported name of the symbol in its source file. */ + sourceName: string; +} + +export type ExportModule = Pick & { + /** Whether this module can export all symbols: `export * from 'module'`. */ + canExportAll: boolean; + /** Members exported from this module. */ + exports: Array; + /** Source file. */ + from: File; + /** Namespace export: `export * as ns from 'module'`. Mutually exclusive with `exports`. */ + namespaceExport?: string; +}; + +export interface ImportMember { + /** Whether this import is type-only. */ + isTypeOnly: boolean; + /** Import flavor. */ + kind: BindingKind; + /** + * The name this symbol will have locally in this file. + * This is where aliasing is applied: + * + * import { Foo as Foo$2 } from "./x" + * + * localName === "Foo$2" + */ + localName: string; + /** The exported name of the symbol in its source file. */ + sourceName: string; +} + +export type ImportModule = Pick & { + /** Source file. */ + from: File; + /** List of symbols imported from this module. */ + imports: Array; + /** Namespace import: `import * as name from 'module'`. Mutually exclusive with `imports`. */ + namespaceImport?: string; +}; diff --git a/packages/codegen-core/src/bindings/types.d.ts b/packages/codegen-core/src/bindings/types.d.ts deleted file mode 100644 index 2510411f9e..0000000000 --- a/packages/codegen-core/src/bindings/types.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface IBinding { - /** - * Optional aliasing map for named symbols. - * - * Keys must be a subset of `names`, values are aliases. - * - * @example { User: "ImportedUser" } - */ - aliases?: Record; - /** - * Name of the default binding, if any. - * - * @example "React" - */ - defaultBinding?: string; - /** - * Source file or external module from which symbols are imported. - * - * @example "./models/user" - * @example "node:path" - */ - from: string; - /** - * Names of the symbols imported from the source. - * - * Must be non-empty unless `namespaceBinding` is true. - * All imported names, regardless of whether they are used as types or values. - * - * @example ["User", "UserDTO"] - */ - names?: ReadonlyArray; - /** - * If this import is a namespace import (e.g. `import * as ns from "..."`), - * this should be the namespace alias. Set to `true` if no alias is needed. - * - * @example "utils" - * @example true - */ - namespaceBinding?: boolean | string; - /** - * Whether the default binding is type-only. - * - * @example true - */ - typeDefaultBinding?: boolean; - /** - * Subset of `names` that are imported using the `type` modifier. - * These symbols will be emitted as type-only imports in TypeScript. - * - * @example ["UserDTO"] - */ - typeNames?: ReadonlyArray; - /** - * Whether the namespace binding is type-only. - * - * @example true - */ - typeNamespaceBinding?: boolean; -} diff --git a/packages/codegen-core/src/bindings/utils.ts b/packages/codegen-core/src/bindings/utils.ts deleted file mode 100644 index 84cf003f4f..0000000000 --- a/packages/codegen-core/src/bindings/utils.ts +++ /dev/null @@ -1,91 +0,0 @@ -import type { IFileOut } from '../files/types'; -import type { ISymbolOut } from '../symbols/types'; -import type { IBinding } from './types'; - -export const createBinding = ({ - file, - modulePath, - symbol, - symbolFile, -}: { - file: IFileOut; - modulePath: string; - symbol: ISymbolOut; - symbolFile: IFileOut; -}): IBinding => { - const names: Array = []; - const typeNames: Array = []; - const binding: IBinding & Pick, 'aliases' | 'from'> = { - aliases: {}, - from: modulePath, - }; - if (symbol.importKind) { - if (symbol.importKind === 'default') { - binding.defaultBinding = symbol.placeholder; - if (symbol.kind === 'type') { - binding.typeDefaultBinding = true; - } - } else if (symbol.importKind === 'namespace') { - binding.namespaceBinding = symbol.placeholder; - if (symbol.kind === 'type') { - binding.typeNamespaceBinding = true; - } - } - } - // default to named binding - if ( - symbol.importKind === 'named' || - (!names.length && !binding.defaultBinding && !binding.namespaceBinding) - ) { - let name = symbol.placeholder; - const fileResolvedName = file.resolvedNames.get(symbol.id); - if (fileResolvedName) { - const symbolFileResolvedName = symbolFile.resolvedNames.get(symbol.id); - if (symbolFileResolvedName) { - if (symbolFileResolvedName !== fileResolvedName) { - name = symbolFileResolvedName; - binding.aliases[name] = fileResolvedName; - } - } else if (symbol.name && fileResolvedName !== symbol.name) { - name = symbol.name; - binding.aliases[name] = symbol.placeholder; - } - } - names.push(name); - if (symbol.kind === 'type') { - typeNames.push(name); - } - } - // cast type names to names to allow for cleaner API, - // otherwise users would have to define the same values twice - for (const typeName of typeNames) { - if (!names.includes(typeName)) { - names.push(typeName); - } - } - binding.names = names; - binding.typeNames = typeNames; - return binding; -}; - -export const mergeBindings = (target: IBinding, source: IBinding): void => { - target.aliases = { ...target.aliases, ...source.aliases }; - if (source.defaultBinding !== undefined) { - target.defaultBinding = source.defaultBinding; - } - target.names = [ - ...new Set([...(target.names ?? []), ...(source.names ?? [])]), - ]; - if (source.namespaceBinding !== undefined) { - target.namespaceBinding = source.namespaceBinding; - } - if (source.typeDefaultBinding !== undefined) { - target.typeDefaultBinding = source.typeDefaultBinding; - } - target.typeNames = [ - ...new Set([...(target.typeNames ?? []), ...(source.typeNames ?? [])]), - ]; - if (source.typeNamespaceBinding !== undefined) { - target.typeNamespaceBinding = source.typeNamespaceBinding; - } -}; diff --git a/packages/codegen-core/src/brands.ts b/packages/codegen-core/src/brands.ts new file mode 100644 index 0000000000..112caeafa7 --- /dev/null +++ b/packages/codegen-core/src/brands.ts @@ -0,0 +1,3 @@ +export const fileBrand = 'heyapi.file'; +export const nodeBrand = 'heyapi.node'; +export const symbolBrand = 'heyapi.symbol'; diff --git a/packages/codegen-core/src/debug.ts b/packages/codegen-core/src/debug.ts new file mode 100644 index 0000000000..44aa6afac1 --- /dev/null +++ b/packages/codegen-core/src/debug.ts @@ -0,0 +1,36 @@ +import colors from 'ansi-colors'; +// @ts-expect-error +import colorSupport from 'color-support'; + +colors.enabled = colorSupport().hasBasic; + +const DEBUG_GROUPS = { + analyzer: colors.greenBright, + dsl: colors.cyanBright, + file: colors.yellowBright, + registry: colors.blueBright, + symbol: colors.magentaBright, +} as const; + +export function debug(message: string, group: keyof typeof DEBUG_GROUPS) { + const value = process.env.DEBUG; + if (!value) return; + + const groups = value.split(',').map((x) => x.trim().toLowerCase()); + + if ( + !( + groups.includes('*') || + groups.includes('heyapi:*') || + groups.includes(`heyapi:${group}`) || + groups.includes(group) + ) + ) { + return; + } + + const color = DEBUG_GROUPS[group] ?? colors.whiteBright; + const prefix = color(`heyapi:${group}`); + + console.debug(`${prefix} ${message}`); +} diff --git a/packages/codegen-core/src/extensions/types.d.ts b/packages/codegen-core/src/extensions.d.ts similarity index 100% rename from packages/codegen-core/src/extensions/types.d.ts rename to packages/codegen-core/src/extensions.d.ts diff --git a/packages/codegen-core/src/files/file.ts b/packages/codegen-core/src/files/file.ts new file mode 100644 index 0000000000..3e5aad1351 --- /dev/null +++ b/packages/codegen-core/src/files/file.ts @@ -0,0 +1,219 @@ +import path from 'node:path'; + +import type { ExportModule, ImportModule } from '../bindings'; +import { fileBrand } from '../brands'; +import { debug } from '../debug'; +import type { Language } from '../languages/types'; +import type { INode } from '../nodes/node'; +import type { NameScopes } from '../planner/types'; +import type { IProject } from '../project/types'; +import type { Renderer } from '../renderer'; +import type { IFileIn } from './types'; + +export class File { + /** + * Exports from this file. + */ + private _exports: Array = []; + /** + * File extension (e.g. `.ts`). + */ + private _extension?: string; + /** + * Actual emitted file path, including extension and directories. + */ + private _finalPath?: string; + /** + * Imports to this file. + */ + private _imports: Array = []; + /** + * Language of the file. + */ + private _language?: Language; + /** + * Logical, extension-free path used for planning and routing. + */ + private _logicalFilePath: string; + /** + * Base name of the file (without extension). + */ + private _name?: string; + /** + * Syntax nodes contained in this file. + */ + private _nodes: Array = []; + /** + * Renderer assigned to this file. + */ + private _renderer?: Renderer; + + /** Brand used for identifying files. */ + readonly '~brand' = fileBrand; + /** All names defined in this file, including local scopes. */ + allNames: NameScopes = new Map(); + /** Whether this file is external to the project. */ + external: boolean; + /** Unique identifier for the file. */ + readonly id: number; + /** The project this file belongs to. */ + readonly project: IProject; + /** Names declared at the top level of the file. */ + topLevelNames: NameScopes = new Map(); + + constructor(input: IFileIn, id: number, project: IProject) { + this.external = input.external ?? false; + this.id = id; + if (input.language !== undefined) this._language = input.language; + this._logicalFilePath = input.logicalFilePath.split(path.sep).join('/'); + if (input.name !== undefined) this._name = input.name; + this.project = project; + } + + /** + * Exports from this file. + */ + get exports(): ReadonlyArray { + return [...this._exports]; + } + + /** + * Read-only accessor for the file extension. + */ + get extension(): string | undefined { + if (this._extension) return this._extension; + const language = this.language; + const extension = language ? this.project.extensions[language] : undefined; + if (extension && extension[0]) return extension[0]; + return; + } + + /** + * Read-only accessor for the final emitted path. + * + * If undefined, the file has not yet been assigned a final path + * or is external to the project and should not be emitted. + */ + get finalPath(): string | undefined { + if (this._finalPath) return this._finalPath; + const dirs = this._logicalFilePath + ? this._logicalFilePath.split('/').slice(0, -1) + : []; + return [...dirs, `${this.name}${this.extension ?? ''}`].join('/'); + } + + /** + * Imports to this file. + */ + get imports(): ReadonlyArray { + return [...this._imports]; + } + + /** + * Language of the file; inferred from nodes or fallback if not set explicitly. + */ + get language(): Language | undefined { + if (this._language) return this._language; + if (this._nodes[0]) return this._nodes[0].language; + return; + } + + /** + * Logical, extension-free path used for planning and routing. + */ + get logicalFilePath(): string { + return this._logicalFilePath; + } + + /** + * Base name of the file (without extension). + * + * If no name was set explicitly, it is inferred from the logical file path. + */ + get name(): string { + if (this._name) return this._name; + const name = this._logicalFilePath.split('/').pop(); + if (name) return name; + const message = `File ${this.toString()} has no name`; + debug(message, 'file'); + throw new Error(message); + } + + /** + * Syntax nodes contained in this file. + */ + get nodes(): ReadonlyArray { + return [...this._nodes]; + } + + /** + * Renderer assigned to this file. + */ + get renderer(): Renderer | undefined { + return this._renderer; + } + + /** + * Add an export group to the file. + */ + addExport(group: ExportModule): void { + this._exports.push(group); + } + + /** + * Add an import group to the file. + */ + addImport(group: ImportModule): void { + this._imports.push(group); + } + + /** + * Add a syntax node to the file. + */ + addNode(node: INode): void { + this._nodes.push(node); + node.file = this; + } + + /** + * Sets the file extension. + */ + setExtension(extension: string): void { + this._extension = extension; + } + + /** + * Sets the final emitted path of the file. + */ + setFinalPath(path: string): void { + this._finalPath = path; + } + + /** + * Sets the language of the file. + */ + setLanguage(lang: Language): void { + this._language = lang; + } + + /** + * Sets the name of the file. + */ + setName(name: string): void { + this._name = name; + } + + /** + * Sets the renderer assigned to this file. + */ + setRenderer(renderer: Renderer): void { + this._renderer = renderer; + } + + /** + * Returns a debug‑friendly string representation identifying the file. + */ + toString(): string { + return `[File ${this._logicalFilePath}#${this.id}]`; + } +} diff --git a/packages/codegen-core/src/files/registry.ts b/packages/codegen-core/src/files/registry.ts index cd89e62dd9..3ed0f74734 100644 --- a/packages/codegen-core/src/files/registry.ts +++ b/packages/codegen-core/src/files/registry.ts @@ -1,133 +1,58 @@ -import { BiMap } from '../bimap/bimap'; -import type { - IFileIdentifier, - IFileIn, - IFileOut, - IFileRegistry, -} from './types'; +import path from 'node:path'; -export class FileRegistry implements IFileRegistry { - private _id: number = 0; - private referenceOrder: Set = new Set(); - private registerOrder: Set = new Set(); - private selectorToId: Map = new Map(); - private values: Map = new Map(); - - get(identifier: IFileIdentifier): IFileOut | undefined { - const file = this.identifierToFile(identifier); - - if (file.id !== undefined) { - return this.values.get(file.id); - } +import type { IProject } from '../project/types'; +import { File } from './file'; +import type { FileKeyArgs, IFileIn, IFileRegistry } from './types'; - const selector = - file.selector !== undefined ? JSON.stringify(file.selector) : undefined; - - if (selector) { - const id = this.selectorToId.get(selector); - if (id !== undefined) { - return this.values.get(id); - } - } +type FileId = number; +type FileKey = string; - return; - } - - get id(): number { - return this._id++; - } +export class FileRegistry implements IFileRegistry { + private _id: FileId = 0; + private _values: Map = new Map(); + private readonly project: IProject; - private identifierToFile( - identifier: IFileIdentifier, - ): Pick { - return typeof identifier === 'number' - ? { id: identifier } - : { selector: identifier }; + constructor(project: IProject) { + this.project = project; } - isRegistered(identifier: IFileIdentifier): boolean { - const file = this.get(identifier); - return file ? this.registerOrder.has(file.id) : false; + get(args: FileKeyArgs): File | undefined { + return this._values.get(this.createFileKey(args)); } - reference(identifier: IFileIdentifier): IFileOut { - const file = this.identifierToFile(identifier); - return this.register(file); + isRegistered(args: FileKeyArgs): boolean { + return this._values.has(this.createFileKey(args)); } - *referenced(): IterableIterator { - for (const id of this.referenceOrder.values()) { - yield this.values.get(id)!; - } + get nextId(): FileId { + return this._id++; } - register(file: IFileIn): IFileOut { - if (file.id !== undefined) { - const result = this.values.get(file.id); - if (!result) { - throw new Error( - `File with ID ${file.id} not found. To register a new file, leave the ID undefined.`, - ); - } - return result; - } - - const hasOtherKeys = Object.keys(file).some( - (key) => !['id', 'selector'].includes(key), - ); - - let result: IFileOut | undefined; - - const selector = - file.selector !== undefined ? JSON.stringify(file.selector) : undefined; - if (selector) { - const id = this.selectorToId.get(selector); - if (id !== undefined) { - result = this.values.get(id); - if (!result) { - throw new Error( - `File with ID ${id} not found. The selector ${selector} matched an ID, but there was no result. This is likely an issue with the application logic.`, - ); - } - if (!hasOtherKeys) { - return result; - } - } - } - - const id = result?.id !== undefined ? result.id : this.id; - result = { - ...result, - ...file, // clone to avoid mutation - id, - resolvedNames: result?.resolvedNames ?? new BiMap(), - symbols: result?.symbols ?? { - body: [], - exports: [], - imports: [], - }, - }; - this.values.set(id, result); + register(file: IFileIn): File { + const key = this.createFileKey(file); - if (hasOtherKeys) { - this.registerOrder.add(id); - if (this.referenceOrder.has(id)) { - this.referenceOrder.delete(id); + let result = this._values.get(key); + if (result) { + if (file.name) { + result.setName(file.name); } } else { - this.referenceOrder.add(id); + result = new File(file, this.nextId, this.project); } - if (selector) { - this.selectorToId.set(selector, id); - } + this._values.set(key, result); return result; } - *registered(): IterableIterator { - for (const id of this.registerOrder.values()) { - yield this.values.get(id)!; + *registered(): IterableIterator { + for (const file of this._values.values()) { + yield file; } } + + private createFileKey(args: FileKeyArgs): string { + const logicalPath = args.logicalFilePath.split(path.sep).join('/'); + return `${args.external ? 'ext:' : ''}${logicalPath}${args.language ? `:${args.language}` : ''}`; + } } diff --git a/packages/codegen-core/src/files/rules.d.ts b/packages/codegen-core/src/files/rules.d.ts new file mode 100644 index 0000000000..3a7c3d7797 --- /dev/null +++ b/packages/codegen-core/src/files/rules.d.ts @@ -0,0 +1,15 @@ +// TODO: use this later +export interface Rules { + /** Whether two exported names may collide. */ + allowExportNameShadowing: boolean; + /** Whether a local symbol can shadow another local name without error. */ + allowLocalNameShadowing: boolean; + /** Whether the language requires file-scoped name uniqueness. */ + fileScopedNamesMustBeUnique: boolean; + /** Whether `import { X } from "mod"` introduces a local binding `X`. */ + importCreatesLocalBinding: boolean; + /** Whether `export { X } from "mod"` introduces a local binding `X`. */ + reexportCreatesLocalBinding: boolean; + /** Whether the language distinguishes type-only imports. */ + supportsTypeImports: boolean; +} diff --git a/packages/codegen-core/src/files/types.d.ts b/packages/codegen-core/src/files/types.d.ts index 892fbe2eae..b235602000 100644 --- a/packages/codegen-core/src/files/types.d.ts +++ b/packages/codegen-core/src/files/types.d.ts @@ -1,19 +1,10 @@ -import type { IBiMap } from '../bimap/types'; +import type { Language } from '../languages/types'; +import type { File } from './file'; -/** - * Selector array used to reference files. - * - * @example ["foo", "bar"] - */ -export type IFileSelector = ReadonlyArray; - -export type IFileIdentifier = number | IFileSelector; +export type FileKeyArgs = Pick, 'logicalFilePath'> & + Pick, 'external' | 'language'>; export type IFileIn = { - /** - * File extension, if any. - */ - extension?: string; /** * Indicates whether the file is external, meaning it is not generated * as part of the project but is referenced (e.g., a module from @@ -23,105 +14,56 @@ export type IFileIn = { */ external?: boolean; /** - * Unique file ID. If one is not provided, it will be auto-generated. - */ - readonly id?: number; - /** - * The desired name for the file within the project. If there are multiple files - * with the same desired name, this might not end up being the actual name. + * Language of the file. * - * @example "UserModel" + * @example "typescript" */ - name?: string; + language?: Language; /** - * Absolute logical output path for the file. + * Logical, extension-free path used for planning and routing. * - * @example "/src/models/user.ts" + * @example "src/models/user" */ - path?: string; + logicalFilePath: string; /** - * Selector array used to select this file. + * The desired name for the file within the project. If there are multiple files + * with the same desired name, this might not end up being the actual name. * - * @example ["foo", "bar"] - */ - readonly selector?: IFileSelector; -}; - -export type IFileOut = IFileIn & { - /** - * Unique file ID. - */ - readonly id: number; - /** - * Map holding resolved names for symbols in this file. - */ - readonly resolvedNames: IBiMap; - /** - * Symbols in this file, categorized by their role. + * @example "UserModel" */ - readonly symbols: { - /** - * Symbols declared in the body of this file. - */ - body: Array; - /** - * Symbols re-exported from other files. - */ - exports: Array; - /** - * Symbols imported from other files. - */ - imports: Array; - }; + name?: string; }; export interface IFileRegistry { /** * Get a file. * - * @param identifier File identifier to reference. * @returns The file, or undefined if not found. */ - get(identifier: IFileIdentifier): IFileOut | undefined; - /** - * Returns the current file ID and increments it. - * - * @returns File ID before being incremented - */ - readonly id: number; + get(args: FileKeyArgs): File | undefined; /** * Returns whether a file is registered in the registry. * - * @param identifier File identifier to check. * @returns True if the file is registered, false otherwise. */ - isRegistered(identifier: IFileIdentifier): boolean; - /** - * Returns a file by identifier, registering it if it doesn't exist. - * - * @param identifier File identifier to reference. - * @returns The referenced or newly registered file. - */ - reference(identifier: IFileIdentifier): IFileOut; + isRegistered(args: FileKeyArgs): boolean; /** - * Get all unregistered files in the order they were referenced. + * Returns the current file ID and increments it. * - * @returns Array of all unregistered files, in reference order. + * @returns File ID before being incremented */ - referenced(): IterableIterator; + readonly nextId: number; /** * Register a file globally. * - * Deduplicates identical files by ID. - * * @param file File to register. - * @returns true if added, false if duplicate. + * @returns Newly registered file if created, merged file otherwise. */ - register(file: IFileIn): IFileOut; + register(file: IFileIn): File; /** * Get all files in the order they were registered. * * @returns Array of all registered files, in insert order. */ - registered(): IterableIterator; + registered(): IterableIterator; } diff --git a/packages/codegen-core/src/guards.ts b/packages/codegen-core/src/guards.ts new file mode 100644 index 0000000000..5fd9564fa4 --- /dev/null +++ b/packages/codegen-core/src/guards.ts @@ -0,0 +1,26 @@ +import { nodeBrand, symbolBrand } from './brands'; +import type { INode } from './nodes/node'; +import type { Ref } from './refs/types'; +import type { Symbol } from './symbols/symbol'; + +export function isBrand(value: unknown, brand: string): value is INode { + if (!value || typeof value !== 'object') return false; + return (value as any)['~brand'] === brand; +} + +export function isNode(value: unknown): value is INode { + if (!value || typeof value !== 'object') return false; + return isBrand(value, nodeBrand); +} + +export function isNodeRef(value: Ref): value is Ref { + return isBrand(value['~ref'], nodeBrand); +} + +export function isSymbol(value: unknown): value is Symbol { + return isBrand(value, symbolBrand); +} + +export function isSymbolRef(value: Ref): value is Ref { + return isBrand(value['~ref'], symbolBrand); +} diff --git a/packages/codegen-core/src/index.ts b/packages/codegen-core/src/index.ts index 22d8c0fd83..307b70a747 100644 --- a/packages/codegen-core/src/index.ts +++ b/packages/codegen-core/src/index.ts @@ -1,22 +1,43 @@ -export type { IBiMap as BiMap } from './bimap/types'; -export type { IBinding as Binding } from './bindings/types'; -export { createBinding, mergeBindings } from './bindings/utils'; +export type { + ExportMember, + ExportModule, + ImportMember, + ImportModule, +} from './bindings'; +export { nodeBrand, symbolBrand } from './brands'; +export { debug } from './debug'; export type { IProjectRenderMeta as ProjectRenderMeta, ISymbolMeta as SymbolMeta, -} from './extensions/types'; +} from './extensions'; +export { File } from './files/file'; +export type { IFileIn as FileIn } from './files/types'; +export { isNode, isNodeRef, isSymbol, isSymbolRef } from './guards'; +export { defaultExtensions } from './languages/extensions'; +export { defaultNameConflictResolvers } from './languages/resolvers'; +export type { + Extensions, + Language, + NameConflictResolvers, +} from './languages/types'; +export type { INode as Node } from './nodes/node'; +export type { IOutput as Output } from './output'; +export { + simpleNameConflictResolver, + underscoreNameConflictResolver, +} from './planner/resolvers'; export type { - IFileOut as File, - IFileIdentifier as FileIdentifier, - IFileIn as FileIn, -} from './files/types'; -export type { IOutput as Output } from './output/types'; + IAnalysisContext as AnalysisContext, + NameConflictResolver, +} from './planner/types'; export { Project } from './project/project'; export type { IProject } from './project/types'; -export type { IRenderer as Renderer } from './renderer/types'; -export { renderIds } from './renderer/utils'; +export { fromRef, fromRefs, isRef, ref, refs } from './refs/refs'; +export type { FromRef, FromRefs, Ref, Refs } from './refs/types'; +export type { RenderContext, Renderer } from './renderer'; +export { Symbol } from './symbols/symbol'; export type { - ISymbolOut as Symbol, + BindingKind, ISymbolIdentifier as SymbolIdentifier, ISymbolIn as SymbolIn, } from './symbols/types'; diff --git a/packages/codegen-core/src/languages/extensions.ts b/packages/codegen-core/src/languages/extensions.ts new file mode 100644 index 0000000000..579bc0cd4e --- /dev/null +++ b/packages/codegen-core/src/languages/extensions.ts @@ -0,0 +1,31 @@ +import type { Extensions } from './types'; + +export const defaultExtensions: Extensions = { + c: ['.c'], + 'c#': ['.cs'], + 'c++': ['.cpp', '.hpp'], + css: ['.css'], + dart: ['.dart'], + go: ['.go'], + haskell: ['.hs'], + html: ['.html'], + java: ['.java'], + javascript: ['.js', '.jsx'], + json: ['.json'], + kotlin: ['.kt'], + lua: ['.lua'], + markdown: ['.md'], + matlab: ['.m'], + perl: ['.pl'], + php: ['.php'], + python: ['.py'], + r: ['.r'], + ruby: ['.rb'], + rust: ['.rs'], + scala: ['.scala'], + shell: ['.sh'], + sql: ['.sql'], + swift: ['.swift'], + typescript: ['.ts', '.tsx'], + yaml: ['.yaml', '.yml'], +}; diff --git a/packages/codegen-core/src/languages/resolvers.ts b/packages/codegen-core/src/languages/resolvers.ts new file mode 100644 index 0000000000..0e8a399539 --- /dev/null +++ b/packages/codegen-core/src/languages/resolvers.ts @@ -0,0 +1,8 @@ +import { underscoreNameConflictResolver } from '../planner/resolvers'; +import type { NameConflictResolvers } from './types'; + +export const defaultNameConflictResolvers: NameConflictResolvers = { + php: underscoreNameConflictResolver, + python: underscoreNameConflictResolver, + ruby: underscoreNameConflictResolver, +}; diff --git a/packages/codegen-core/src/languages/types.d.ts b/packages/codegen-core/src/languages/types.d.ts new file mode 100644 index 0000000000..707d581233 --- /dev/null +++ b/packages/codegen-core/src/languages/types.d.ts @@ -0,0 +1,37 @@ +import type { NameConflictResolver } from '../planner/types'; + +export type Extensions = Partial>>; + +export type Language = + | 'c' + | 'c#' + | 'c++' + | 'css' + | 'dart' + | 'go' + | 'haskell' + | 'html' + | 'java' + | 'javascript' + | 'json' + | 'kotlin' + | 'lua' + | 'markdown' + | 'matlab' + | 'perl' + | 'php' + | 'python' + | 'r' + | 'ruby' + | 'rust' + | 'scala' + | 'shell' + | 'sql' + | 'swift' + | 'typescript' + | 'yaml' + | (string & {}); // other/custom language + +export type NameConflictResolvers = Partial< + Record +>; diff --git a/packages/codegen-core/src/nodes/node.d.ts b/packages/codegen-core/src/nodes/node.d.ts new file mode 100644 index 0000000000..1c98489e6a --- /dev/null +++ b/packages/codegen-core/src/nodes/node.d.ts @@ -0,0 +1,25 @@ +import type { File } from '../files/file'; +import type { Language } from '../languages/types'; +import type { IAnalysisContext } from '../planner/types'; +import type { Symbol } from '../symbols/symbol'; + +export interface INode { + /** Perform semantic analysis. */ + analyze(ctx: IAnalysisContext): void; + /** Whether this node is exported from its file. */ + exported?: boolean; + /** The file this node belongs to. */ + file?: File; + /** The programming language associated with this node */ + language: Language; + /** Parent node in the syntax tree. */ + parent?: INode; + /** Root node of the syntax tree. */ + root?: INode; + /** The symbol associated with this node. */ + symbol?: Symbol; + /** Convert this node into AST representation. */ + toAst(): T; + /** Brand used for renderer dispatch. */ + readonly '~brand': string; +} diff --git a/packages/codegen-core/src/nodes/registry.ts b/packages/codegen-core/src/nodes/registry.ts new file mode 100644 index 0000000000..b126feaaa5 --- /dev/null +++ b/packages/codegen-core/src/nodes/registry.ts @@ -0,0 +1,28 @@ +import { fromRef, ref } from '../refs/refs'; +import type { Ref } from '../refs/types'; +import type { INode } from './node'; +import type { INodeRegistry } from './types'; + +export class NodeRegistry implements INodeRegistry { + private list: Array> = []; + + add(node: INode | null): number { + const index = this.list.push(ref(node)); + return index - 1; + } + + *all(): Iterable { + for (const r of this.list) { + const node = fromRef(r); + if (node) yield node; + } + } + + remove(index: number): void { + this.list[index] = ref(null); + } + + update(index: number, node: INode | null): void { + this.list[index] = ref(node); + } +} diff --git a/packages/codegen-core/src/nodes/types.d.ts b/packages/codegen-core/src/nodes/types.d.ts new file mode 100644 index 0000000000..4b53c76507 --- /dev/null +++ b/packages/codegen-core/src/nodes/types.d.ts @@ -0,0 +1,27 @@ +import type { INode } from './node'; + +export interface INodeRegistry { + /** + * Register a syntax node. + * + * @returns The index of the registered node. + */ + add(node: INode | null): number; + /** + * All nodes in insertion order. + */ + all(): Iterable; + /** + * Remove a node by its index. + * + * @param index Index of the node to remove. + */ + remove(index: number): void; + /** + * Update a node at the given index. + * + * @param index Index of the node to update. + * @param node New node to set. + */ + update(index: number, node: INode | null): void; +} diff --git a/packages/codegen-core/src/output/types.d.ts b/packages/codegen-core/src/output.d.ts similarity index 100% rename from packages/codegen-core/src/output/types.d.ts rename to packages/codegen-core/src/output.d.ts diff --git a/packages/codegen-core/src/planner/analyzer.ts b/packages/codegen-core/src/planner/analyzer.ts new file mode 100644 index 0000000000..1af9bfab95 --- /dev/null +++ b/packages/codegen-core/src/planner/analyzer.ts @@ -0,0 +1,109 @@ +import { isNodeRef, isSymbolRef } from '../guards'; +import type { INode } from '../nodes/node'; +import { fromRef, isRef, ref } from '../refs/refs'; +import type { Ref } from '../refs/types'; +import type { Symbol } from '../symbols/symbol'; +import type { IAnalysisContext, Input, NameScopes, Scope } from './types'; + +const createScope = (parent?: Scope): Scope => ({ + children: [], + localNames: new Map(), + parent, + symbols: [], +}); + +export class AnalysisContext implements IAnalysisContext { + scopes: Scope = createScope(); + symbol?: Symbol; + scope: Scope = this.scopes; + + constructor(symbol?: Symbol) { + this.symbol = symbol; + } + + addDependency(symbol: Ref): void { + if (this.symbol !== fromRef(symbol)) { + this.scope.symbols.push(symbol); + } + } + + analyze(input: Input): void { + const v = isRef(input) ? input : ref(input); + if (isSymbolRef(v)) { + this.addDependency(v); + } else if (isNodeRef(v)) { + fromRef(v).analyze(this); + } + } + + localNames(scope: Scope): NameScopes { + const names: NameScopes = new Map(); + for (const [name, kinds] of scope.localNames) { + names.set(name, new Set(kinds)); + } + if (scope.parent) { + const parentNames = this.localNames(scope.parent); + for (const [name, kinds] of parentNames) { + if (!names.has(name)) { + names.set(name, kinds); + } else { + const existingKinds = names.get(name)!; + for (const kind of kinds) { + existingKinds.add(kind); + } + } + } + } + return names; + } + + popScope(): void { + this.scope = this.scope.parent ?? this.scope; + } + + pushScope(): void { + const scope = createScope(this.scope); + this.scope.children.push(scope); + this.scope = scope; + } + + walkScopes( + callback: (symbol: Ref, scope: Scope) => void, + scope: Scope = this.scopes, + ): void { + this.scope = scope; + for (const symbol of scope.symbols) { + callback(symbol, scope); + } + for (const child of scope.children) { + scope = child; + this.walkScopes(callback, scope); + } + this.scope = this.scopes; + } +} + +export class Analyzer { + private nodeCache = new WeakMap(); + + analyzeNode(node: INode): AnalysisContext { + const cached = this.nodeCache.get(node); + if (cached) return cached; + + const ctx = new AnalysisContext(node.symbol); + node.analyze(ctx); + + this.nodeCache.set(node, ctx); + return ctx; + } + + analyze( + nodes: Iterable, + callback?: (ctx: AnalysisContext, node: INode) => void, + ): void { + for (const node of nodes) { + const ctx = this.analyzeNode(node); + callback?.(ctx, node); + } + } +} diff --git a/packages/codegen-core/src/planner/planner.ts b/packages/codegen-core/src/planner/planner.ts new file mode 100644 index 0000000000..ca0467166a --- /dev/null +++ b/packages/codegen-core/src/planner/planner.ts @@ -0,0 +1,430 @@ +import path from 'node:path'; + +import type { ExportModule, ImportModule } from '../bindings'; +import type { IProjectRenderMeta } from '../extensions'; +import type { File } from '../files/file'; +import type { IFileIn } from '../files/types'; +import { canShareName } from '../project/namespace'; +import type { IProject } from '../project/types'; +import { fromRef } from '../refs/refs'; +import type { RenderContext } from '../renderer'; +import type { Symbol } from '../symbols/symbol'; +import type { SymbolKind } from '../symbols/types'; +import type { AnalysisContext } from './analyzer'; +import { Analyzer } from './analyzer'; +import type { AssignOptions, NameScopes } from './types'; + +const isTypeOnlyKind = (kind: SymbolKind) => + kind === 'type' || kind === 'interface'; + +export class Planner { + private readonly analyzer = new Analyzer(); + private readonly cacheResolvedNames = new Set(); + private readonly project: IProject; + + constructor(project: IProject) { + this.project = project; + } + + /** + * Executes the planning phase for the project. + */ + plan(meta?: IProjectRenderMeta) { + this.cacheResolvedNames.clear(); + this.allocateFiles(); + this.assignLocalNames(); + this.resolveFilePaths(meta); + this.planExports(); + this.planImports(); + } + + /** + * Creates and assigns a file to every node, re-export, + * and external dependency. + */ + private allocateFiles(): void { + this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => { + const symbol = node.symbol; + if (!symbol) return; + + const file = this.project.files.register(this.symbolToFileIn(symbol)); + file.addNode(node); + symbol.setFile(file); + for (const exportFrom of symbol.exportFrom) { + this.project.files.register({ + external: false, + language: file.language, + logicalFilePath: exportFrom, + }); + } + ctx.walkScopes((dependency) => { + const dep = fromRef(dependency); + if (dep.external && dep.isCanonical && !dep.file) { + const file = this.project.files.register(this.symbolToFileIn(dep)); + dep.setFile(file); + } + }); + }); + } + + /** + * Assigns final names to all symbols. + * + * First assigns top-level (file-scoped) symbol names, then local symbols. + */ + private assignLocalNames(): void { + this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => { + const symbol = node.symbol; + if (!symbol) return; + this.assignTopLevelName(symbol, ctx); + }); + + this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => { + const file = node.file; + if (!file) return; + ctx.walkScopes((dependency) => { + const dep = fromRef(dependency); + // top-level or external symbol + if (dep.file) return; + this.assignLocalName(dep, ctx, { + scopesToUpdate: [file.allNames], + }); + }); + }); + } + + /** + * Resolves and sets final file paths for all non-external files. Attaches renderers. + * + * Uses the project's fileName function if provided, otherwise uses the file's current name. + * + * Resolves final paths relative to the project's root directory. + */ + private resolveFilePaths(meta?: IProjectRenderMeta): void { + for (const file of this.project.files.registered()) { + if (file.external) continue; + const finalName = this.project.fileName?.(file.name) || file.name; + file.setName(finalName); + const finalPath = file.finalPath; + if (finalPath) { + file.setFinalPath(path.resolve(this.project.root, finalPath)); + } + const ctx: RenderContext = { file, meta, project: this.project }; + const renderer = this.project.renderers.find((r) => r.supports(ctx)); + if (renderer) file.setRenderer(renderer); + } + } + + /** + * Plans exports by analyzing all exported symbols. + * + * Registers re-export targets as files and creates new exported symbols for them. + * + * Assigns names to re-exported symbols and collects re-export metadata, + * distinguishing type-only exports based on symbol kinds. + */ + private planExports(): void { + const seenByFile = new Map< + File, + Map; symbol: Symbol }> + >(); + const sourceFile = new Map(); + + this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => { + if (!node.exported) return; + + const symbol = node.symbol; + if (!symbol) return; + + const file = node.file; + if (!file) return; + + for (const exportFrom of symbol.exportFrom) { + const target = this.project.files.register({ + external: false, + language: node.language, + logicalFilePath: exportFrom, + }); + if (target.id === file.id) continue; + + let fileMap = seenByFile.get(target); + if (!fileMap) { + fileMap = new Map(); + seenByFile.set(target, fileMap); + } + + const exp = this.project.symbols.register({ + exported: true, + external: symbol.external, + importKind: symbol.importKind, + kind: symbol.kind, + name: symbol.finalName, + }); + exp.setFile(target); + sourceFile.set(exp.id, file); + this.assignTopLevelName(exp, ctx); + + let entry = fileMap.get(exp.finalName); + if (!entry) { + entry = { kinds: new Set(), symbol: exp }; + fileMap.set(exp.finalName, entry); + } + entry.kinds.add(exp.kind); + } + }); + + for (const [file, fileMap] of seenByFile) { + const exports = new Map(); + for (const [, entry] of fileMap) { + const source = sourceFile.get(entry.symbol.id)!; + let exp = exports.get(source); + if (!exp) { + exp = { + canExportAll: true, + exports: [], + from: source, + isTypeOnly: true, + }; + } + const isTypeOnly = [...entry.kinds].every((kind) => + isTypeOnlyKind(kind), + ); + const exportedName = entry.symbol.finalName; + exp.exports.push({ + exportedName, + isTypeOnly, + kind: entry.symbol.importKind, + sourceName: entry.symbol.name, + }); + if (entry.symbol.name !== entry.symbol.finalName) { + exp.canExportAll = false; + } + if (!isTypeOnly) { + exp.isTypeOnly = false; + } + exports.set(source, exp); + } + for (const [, exp] of exports) { + file.addExport(exp); + } + } + } + + /** + * Plans imports by analyzing symbol dependencies across files. + * + * For external dependencies, assigns top-level names. + * + * Creates or reuses import symbols for dependencies from other files, + * assigning names and updating import metadata including type-only flags. + */ + private planImports(): void { + const seenByFile = new Map< + File, + Map< + string, + { + dep: Symbol; + kinds: Set; + symbol: Symbol; + } + > + >(); + + this.analyzer.analyze(this.project.nodes.all(), (ctx) => { + const symbol = ctx.symbol; + if (!symbol) return; + + const file = symbol.file; + if (!file) return; + + let fileMap = seenByFile.get(file); + if (!fileMap) { + fileMap = new Map(); + seenByFile.set(file, fileMap); + } + + ctx.walkScopes((dependency) => { + const dep = fromRef(dependency); + if (!dep.file || dep.file.id === file.id) return; + + if (dep.external) { + this.assignTopLevelName(dep, ctx); + } + + const fromFileId = dep.file.id; + const importedName = dep.finalName; + const isTypeOnly = isTypeOnlyKind(dep.kind); + const kind = dep.importKind; + const key = `${fromFileId}|${importedName}|${kind}|${isTypeOnly}`; + + let entry = fileMap.get(key); + if (!entry) { + const imp = this.project.symbols.register({ + exported: dep.exported, + external: dep.external, + importKind: dep.importKind, + kind: dep.kind, + name: dep.finalName, + }); + imp.setFile(file); + this.assignTopLevelName(imp, ctx, { + scope: imp.file!.allNames, + }); + entry = { + dep, + kinds: new Set(), + symbol: imp, + }; + fileMap.set(key, entry); + entry.kinds.add(imp.kind); + } + + dependency['~ref'] = entry.symbol; + }); + }); + + for (const [file, fileMap] of seenByFile) { + const imports = new Map(); + for (const [, entry] of fileMap) { + const source = entry.dep.file!; + let imp = imports.get(source); + if (!imp) { + imp = { + from: source, + imports: [], + isTypeOnly: true, + }; + } + const isTypeOnly = [...entry.kinds].every((kind) => + isTypeOnlyKind(kind), + ); + if (entry.symbol.importKind === 'namespace') { + imp.imports = []; + imp.namespaceImport = entry.symbol.finalName; + } else { + imp.imports.push({ + isTypeOnly, + kind: entry.symbol.importKind, + localName: entry.symbol.finalName, + sourceName: entry.dep.finalName, + }); + } + if (!isTypeOnly) { + imp.isTypeOnly = false; + } + imports.set(source, imp); + } + for (const [, imp] of imports) { + file.addImport(imp); + } + } + } + + /** + * Assigns the final name to a top-level (file-scoped) symbol. + * + * Uses the symbol's file top-level names as the default scope, + * and updates all relevant name scopes including the file's allNames and local scopes. + * + * Supports optional overrides for the naming scope and scopes to update. + */ + private assignTopLevelName( + symbol: Symbol, + ctx: AnalysisContext, + options?: Partial, + ): void { + if (!symbol.file) return; + this.assignSymbolName(symbol, { + scope: options?.scope ?? symbol.file.topLevelNames, + scopesToUpdate: [ + symbol.file.allNames, + ctx.scopes.localNames, + ...(options?.scopesToUpdate ?? []), + ], + }); + } + + /** + * Assigns the final name to a non-top-level (local) symbol. + * + * Uses the provided scope or derives it from the current analysis context's local names. + * + * Updates all provided name scopes accordingly. + */ + private assignLocalName( + symbol: Symbol, + ctx: AnalysisContext, + options: Pick, 'scope'> & + Pick, + ): void { + this.assignSymbolName(symbol, { + scope: options.scope ?? ctx.localNames(ctx.scope), + scopesToUpdate: options.scopesToUpdate, + }); + } + + /** + * Assigns the final name to a symbol within the provided name scope. + * + * Resolves name conflicts until a unique name is found. + * + * Updates all specified name scopes with the assigned final name. + */ + private assignSymbolName(symbol: Symbol, options: AssignOptions): void { + if (this.cacheResolvedNames.has(symbol.id)) return; + + const baseName = symbol.name; + let finalName = symbol.nameSanitizer?.(baseName) ?? baseName; + let attempt = 1; + + while (true) { + const kinds = [...(options.scope.get(finalName) ?? [])]; + + const ok = kinds.every((kind) => canShareName(symbol.kind, kind)); + if (ok) break; + + const language = symbol.node?.language || symbol.file?.language; + const resolver = + (language ? this.project.nameConflictResolvers[language] : undefined) ?? + this.project.defaultNameConflictResolver; + const resolvedName = resolver({ attempt, baseName }); + if (!resolvedName) { + throw new Error(`Unresolvable name conflict: ${symbol.toString()}`); + } + + finalName = symbol.nameSanitizer?.(resolvedName) ?? resolvedName; + attempt = attempt + 1; + } + + symbol.setFinalName(finalName); + this.cacheResolvedNames.add(symbol.id); + const updateScopes = [options.scope, ...options.scopesToUpdate]; + for (const scope of updateScopes) { + this.updateScope(symbol, scope); + } + } + + /** + * Updates the provided name scope with the symbol's final name and kind. + * + * Ensures the name scope tracks all kinds associated with a given name. + */ + private updateScope(symbol: Symbol, scope: NameScopes): void { + const name = symbol.finalName; + const cache = scope.get(name) ?? new Set(); + cache.add(symbol.kind); + scope.set(name, cache); + } + + private symbolToFileIn(symbol: Symbol): IFileIn { + return { + external: Boolean(symbol.external), + language: symbol.node?.language, + logicalFilePath: + symbol.external || + symbol.getFilePath?.(symbol) || + this.project.defaultFileName, + } satisfies IFileIn; + } +} diff --git a/packages/codegen-core/src/planner/resolvers.ts b/packages/codegen-core/src/planner/resolvers.ts new file mode 100644 index 0000000000..445384cc73 --- /dev/null +++ b/packages/codegen-core/src/planner/resolvers.ts @@ -0,0 +1,11 @@ +import type { NameConflictResolver } from './types'; + +export const simpleNameConflictResolver: NameConflictResolver = ({ + attempt, + baseName, +}) => (attempt === 0 ? baseName : `${baseName}${attempt + 1}`); + +export const underscoreNameConflictResolver: NameConflictResolver = ({ + attempt, + baseName, +}) => (attempt === 0 ? baseName : `${baseName}_${attempt + 1}`); diff --git a/packages/codegen-core/src/planner/types.d.ts b/packages/codegen-core/src/planner/types.d.ts new file mode 100644 index 0000000000..aa98ed3d7a --- /dev/null +++ b/packages/codegen-core/src/planner/types.d.ts @@ -0,0 +1,54 @@ +import type { Ref } from '../refs/types'; +import type { Symbol } from '../symbols/symbol'; +import type { SymbolKind } from '../symbols/types'; + +export type AssignOptions = { + /** The primary scope in which to assign a symbol's final name. */ + scope: NameScopes; + /** Additional scopes to update as side effects when assigning a symbol's final name. */ + scopesToUpdate: ReadonlyArray; +}; + +export type Input = Ref | object | string | number | undefined; + +export type NameScopes = Map>; + +export type NameConflictResolver = (args: { + attempt: number; + baseName: string; +}) => string | null; + +export type Scope = { + /** Child scopes. */ + children: Array; + /** Resolved names in this scope. */ + localNames: NameScopes; + /** Parent scope, if any. */ + parent?: Scope; + /** Symbols registered in this scope. */ + symbols: Array>; +}; + +export interface IAnalysisContext { + /** Register a dependency on another symbol. */ + addDependency(symbol: Ref): void; + /** Register a dependency on another symbol or analyze further. */ + analyze(input: Input): void; + /** Get local names in the current scope. */ + localNames(scope: Scope): NameScopes; + /** Pop the current local scope. */ + popScope(): void; + /** Push a new local scope. */ + pushScope(): void; + /** Current local scope. */ + scope: Scope; + /** Stack of local name scopes. */ + scopes: Scope; + /** Top-level symbol for the current analysis pass. */ + symbol?: Symbol; + /** Walks all symbols in the scope tree in depth-first order. */ + walkScopes( + callback: (symbol: Ref, scope: Scope) => void, + scope?: Scope, + ): void; +} diff --git a/packages/codegen-core/src/project/namespace.ts b/packages/codegen-core/src/project/namespace.ts new file mode 100644 index 0000000000..d6b1aaa1d0 --- /dev/null +++ b/packages/codegen-core/src/project/namespace.ts @@ -0,0 +1,77 @@ +import type { SymbolKind } from '../symbols/types'; + +/** + * Returns true if two declarations of given kinds + * are allowed to share the same identifier in TypeScript. + */ +export function canShareName(a: SymbolKind, b: SymbolKind): boolean { + // same-kind always valid for interfaces (merging) + if (a === 'interface' && b === 'interface') return true; + + // type vs interface merges + if ( + (a === 'interface' && b === 'type') || + (a === 'type' && b === 'interface') + ) { + return false; // TypeScript does NOT merge type-alias with interface. + } + + // type vs type = conflict + if (a === 'type' && b === 'type') return false; + + // interface vs class = allowed (declare-merge) + if ( + (a === 'interface' && b === 'class') || + (a === 'class' && b === 'interface') + ) { + return true; + } + + // enum vs namespace = allowed (merges into value+type) + if ( + (a === 'enum' && b === 'namespace') || + (a === 'namespace' && b === 'enum') + ) { + return true; + } + + // class vs namespace = allowed + if ( + (a === 'class' && b === 'namespace') || + (a === 'namespace' && b === 'class') + ) { + return true; + } + + // namespace vs namespace = allowed (merging) + if (a === 'namespace' && b === 'namespace') return true; + + // enum vs enum = conflict IF values conflict (TypeScript flags duplicates) + if (a === 'enum' && b === 'enum') return false; + + // function and namespace merge (namespace can augment function) + if ( + (a === 'function' && b === 'namespace') || + (a === 'namespace' && b === 'function') + ) { + return true; + } + + // these collide with each other in the value namespace + const valueKinds = new Set(['class', 'enum', 'function', 'var']); + + const aInValue = valueKinds.has(a); + const bInValue = valueKinds.has(b); + + if (aInValue && bInValue) return false; + + // type-only declarations do not collide with value-only declarations + const typeKinds = new Set(['interface', 'type']); + const aInType = typeKinds.has(a); + const bInType = typeKinds.has(b); + + // if one is type-only and the other is value-only, they do NOT collide + if (aInType !== bInType) return true; + + return true; +} diff --git a/packages/codegen-core/src/project/project.ts b/packages/codegen-core/src/project/project.ts index c479b54287..d31f5bb60e 100644 --- a/packages/codegen-core/src/project/project.ts +++ b/packages/codegen-core/src/project/project.ts @@ -1,146 +1,71 @@ import path from 'node:path'; -import type { IProjectRenderMeta } from '../extensions/types'; +import type { IProjectRenderMeta } from '../extensions'; import { FileRegistry } from '../files/registry'; -import type { IFileOut, IFileSelector } from '../files/types'; -import type { IOutput } from '../output/types'; -import type { IRenderer } from '../renderer/types'; +import { defaultExtensions } from '../languages/extensions'; +import { defaultNameConflictResolvers } from '../languages/resolvers'; +import type { Extensions, NameConflictResolvers } from '../languages/types'; +import { NodeRegistry } from '../nodes/registry'; +import type { IOutput } from '../output'; +import { Planner } from '../planner/planner'; +import { simpleNameConflictResolver } from '../planner/resolvers'; +import type { NameConflictResolver } from '../planner/types'; +import type { Renderer } from '../renderer'; import { SymbolRegistry } from '../symbols/registry'; -import type { ISymbolOut } from '../symbols/types'; import type { IProject } from './types'; -const externalSourceSymbol = '@'; - export class Project implements IProject { - private symbolIdToFileIds: Map> = new Map(); + readonly files: FileRegistry; + readonly nodes = new NodeRegistry(); + readonly symbols = new SymbolRegistry(); readonly defaultFileName: string; - readonly files = new FileRegistry(); + readonly defaultNameConflictResolver: NameConflictResolver; + readonly extensions: Extensions; readonly fileName?: (name: string) => string; - readonly renderers: Record = {}; + readonly nameConflictResolvers: NameConflictResolvers; + readonly renderers: ReadonlyArray; readonly root: string; - readonly symbols = new SymbolRegistry(); - constructor({ - defaultFileName, - fileName, - renderers, - root, - }: Pick) { - this.defaultFileName = defaultFileName ?? 'main'; + constructor( + args: Pick< + Partial, + | 'defaultFileName' + | 'defaultNameConflictResolver' + | 'extensions' + | 'fileName' + | 'nameConflictResolvers' + | 'renderers' + > & + Pick, + ) { + const fileName = args.fileName; + this.defaultFileName = args.defaultFileName ?? 'main'; + this.defaultNameConflictResolver = + args.defaultNameConflictResolver ?? simpleNameConflictResolver; + this.extensions = { + ...defaultExtensions, + ...args.extensions, + }; this.fileName = typeof fileName === 'string' ? () => fileName : fileName; - this.renderers = renderers; - this.root = root; - } - - private getRenderer(file: IFileOut): IRenderer | undefined { - return file.extension ? this.renderers[file.extension] : undefined; - } - - private prepareFiles(): void { - // TODO: infer extension from symbols - const extension = '.ts'; - for (const symbol of this.symbols.registered()) { - const selector = this.symbolToFileSelector(symbol); - const file = this.files.reference(selector); - file.symbols.body.push(symbol.id); - // update symbol->files map - const symbolIdToFileIds = - this.symbolIdToFileIds.get(symbol.id) ?? new Set(); - symbolIdToFileIds.add(file.id); - this.symbolIdToFileIds.set(symbol.id, symbolIdToFileIds); - // update re-exports - if (symbol.exportFrom) { - for (const exportFrom of symbol.exportFrom) { - const exportSelector = [exportFrom]; - const exportFile = this.files.reference(exportSelector); - if (exportFile.id !== file.id) { - exportFile.symbols.exports.push(symbol.id); - } - } - } - } - for (const file of this.files.referenced()) { - if (!file.selector) continue; - if (file.selector[0] === externalSourceSymbol) { - const filePath = file.selector[1]; - if (!filePath) { - this.files.register({ - external: true, - selector: file.selector, - }); - continue; - } - const extension = path.extname(filePath); - if (!extension) { - this.files.register({ - external: true, - path: filePath, - selector: file.selector, - }); - continue; - } - this.files.register({ - extension, - external: true, - path: filePath, - selector: file.selector, - }); - continue; - } - const dirs = file.selector.slice(0, -1); - let name = file.selector[file.selector.length - 1]!; - name = this.fileName?.(name) || name; - this.files.register({ - extension, - name, - path: path.resolve(this.root, ...dirs, `${name}${extension}`), - selector: file.selector, - }); - } - - // TODO: track symbol dependencies and inject imports into files - // based on symbol references so the render step can just render + this.files = new FileRegistry(this); + this.nameConflictResolvers = { + ...defaultNameConflictResolvers, + ...args.nameConflictResolvers, + }; + this.renderers = args.renderers ?? []; + this.root = path.resolve(args.root).replace(/[/\\]+$/, ''); } render(meta?: IProjectRenderMeta): ReadonlyArray { - this.prepareFiles(); - const files: Map = new Map(); + new Planner(this).plan(meta); + const files: Array = []; for (const file of this.files.registered()) { - if (file.external || !file.path) continue; - const renderer = this.getRenderer(file); - if (!renderer) continue; - files.set(file.id, { - content: renderer.renderSymbols(file, this, meta), - path: file.path, - }); - } - for (const [fileId, value] of files.entries()) { - const file = this.files.get(fileId)!; - const renderer = this.getRenderer(file)!; - const content = renderer.renderFile(value.content, file, this, meta); - if (content) { - files.set(file.id, { ...value, content }); - } else { - files.delete(file.id); + if (file.finalPath && file.renderer) { + const content = file.renderer.render({ file, meta, project: this }); + files.push({ content, path: file.finalPath }); } } - return Array.from(files.values()); - } - - symbolIdToFiles(symbolId: number): ReadonlyArray { - const fileIds = this.symbolIdToFileIds.get(symbolId); - return Array.from(fileIds ?? []).map((fileId) => this.files.get(fileId)!); - } - - private symbolToFileSelector(symbol: ISymbolOut): IFileSelector { - if (symbol.external) { - return [externalSourceSymbol, symbol.external]; - } - const filePath = symbol.getFilePath?.(symbol); - if (filePath) { - return filePath.split('/'); - } - return [this.defaultFileName]; + return files; } } diff --git a/packages/codegen-core/src/project/types.d.ts b/packages/codegen-core/src/project/types.d.ts index 22d2c6ba79..016930def7 100644 --- a/packages/codegen-core/src/project/types.d.ts +++ b/packages/codegen-core/src/project/types.d.ts @@ -1,11 +1,15 @@ -import type { IProjectRenderMeta } from '../extensions/types'; -import type { IFileOut, IFileRegistry } from '../files/types'; -import type { IOutput } from '../output/types'; -import type { IRenderer } from '../renderer/types'; +import type { IProjectRenderMeta } from '../extensions'; +import type { IFileRegistry } from '../files/types'; +import type { Extensions, NameConflictResolvers } from '../languages/types'; +import type { INodeRegistry } from '../nodes/types'; +import type { IOutput } from '../output'; +import type { NameConflictResolver } from '../planner/types'; +import type { Renderer } from '../renderer'; import type { ISymbolRegistry } from '../symbols/types'; /** - * Represents a code generation project consisting of multiple codegen files. + * Represents a code generation project consisting of codegen files. + * * Manages imports, symbols, and output generation across the project. */ export interface IProject { @@ -14,18 +18,24 @@ export interface IProject { * * @default 'main' */ - readonly defaultFileName?: string; + readonly defaultFileName: string; + /** Default name conflict resolver used when a file has no specific resolver. */ + readonly defaultNameConflictResolver: NameConflictResolver; + /** Maps language to array of extensions. First element is used by default. */ + readonly extensions: Extensions; /** - * Optional function to transform file names before they are used. + * Function to transform file names before they are used. * * @param name The original file name. * @returns The transformed file name. */ readonly fileName?: (name: string) => string; - /** - * Centralized file registry for the project. - */ + /** Centralized file registry for the project. */ readonly files: IFileRegistry; + /** Map of language-specific name conflict resolvers for files in the project. */ + readonly nameConflictResolvers: NameConflictResolvers; + /** Centralized node registry for the project. */ + readonly nodes: INodeRegistry; /** * Produces output representations for all files in the project. * @@ -36,34 +46,14 @@ export interface IProject { */ render(meta?: IProjectRenderMeta): ReadonlyArray; /** - * Map of available renderers by file extension. + * List of available renderers. * * @example - * { - * ".ts": tsRenderer, - * ".js": jsRenderer, - * } - */ - readonly renderers: Record; - /** - * The absolute path to the root folder of the project. + * [new TypeScriptRenderer()] */ + readonly renderers: ReadonlyArray; + /** The absolute path to the root folder of the project. */ readonly root: string; - /** - * Retrieves files that include symbol ID. The first file is the one - * where the symbol is declared, the rest are files that re-export it. - * - * @param symbolId The symbol ID to find. - * @returns An array of files containing the symbol. - * @example - * const files = project.symbolIdToFiles(31); - * for (const file of files) { - * console.log(file.path); - * } - */ - symbolIdToFiles(symbolId: number): ReadonlyArray; - /** - * Centralized symbol registry for the project. - */ + /** Centralized symbol registry for the project. */ readonly symbols: ISymbolRegistry; } diff --git a/packages/codegen-core/src/refs/refs.ts b/packages/codegen-core/src/refs/refs.ts new file mode 100644 index 0000000000..c5797bc926 --- /dev/null +++ b/packages/codegen-core/src/refs/refs.ts @@ -0,0 +1,76 @@ +import type { FromRefs, Ref, Refs } from './types'; + +/** + * Wraps a single value in a Ref object. + * + * @example + * ```ts + * const r = ref(123); // { '~ref': 123 } + * console.log(r['~ref']); // 123 + * ``` + */ +export const ref = (value: T): Ref => ({ '~ref': value }); + +/** + * Converts a plain object to an object of Refs (deep, per property). + * + * @example + * ```ts + * const obj = { a: 1, b: "x" }; + * const refs = refs(obj); // { a: { '~ref': 1 }, b: { '~ref': "x" } } + * ``` + */ +export const refs = >(obj: T): Refs => { + const result = {} as Refs; + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + result[key] = ref(obj[key]); + } + } + return result; +}; + +/** + * Unwraps a single Ref object to its value. + * + * @example + * ```ts + * const r = { '~ref': 42 }; + * const n = fromRef(r); // 42 + * console.log(n); // 42 + * ``` + */ +export const fromRef = | undefined>( + ref: T, +): T extends Ref ? U : undefined => + ref?.['~ref'] as T extends Ref ? U : undefined; + +/** + * Converts an object of Refs back to a plain object (unwraps all refs). + * + * @example + * ```ts + * const refs = { a: { '~ref': 1 }, b: { '~ref': "x" } }; + * const plain = fromRefs(refs); // { a: 1, b: "x" } + * ``` + */ +export const fromRefs = >>( + obj: T, +): FromRefs => { + const result = {} as FromRefs; + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + result[key] = fromRef(obj[key]!) as (typeof result)[typeof key]; + } + } + return result; +}; + +/** + * Checks whether a value is a Ref object. + * + * @param value Value to check + * @returns True if the value is a Ref object. + */ +export const isRef = (value: unknown): value is Ref => + typeof value === 'object' && value !== null && '~ref' in value; diff --git a/packages/codegen-core/src/refs/types.d.ts b/packages/codegen-core/src/refs/types.d.ts new file mode 100644 index 0000000000..f5b76fbeb9 --- /dev/null +++ b/packages/codegen-core/src/refs/types.d.ts @@ -0,0 +1,50 @@ +/** + * Ref wrapper which ensures a stable reference for a value. + * + * @example + * ```ts + * type NumRef = Ref; // { '~ref': number } + * const num: NumRef = { '~ref': 42 }; + * console.log(num['~ref']); // 42 + * ``` + */ +export type Ref = { '~ref': T }; + +/** + * Maps every property of `T` to a `Ref` of that property. + * + * @example + * ```ts + * type Foo = { a: number; b: string }; + * type Refs = Refs; // { a: Ref; b: Ref } + * const refs: Refs = { a: { '~ref': 1 }, b: { '~ref': 'x' } }; + * console.log(refs.a['~ref'], refs.b['~ref']); // 1 'x' + * ``` + */ +export type Refs = { + [K in keyof T]: Ref; +}; + +/** + * Unwraps a Ref to its value type. + * + * @example + * ```ts + * type N = FromRef<{ '~ref': number }>; // number + * ``` + */ +export type FromRef = T extends Ref ? V : T; + +/** + * Maps every property of a Ref-wrapped object back to its plain value. + * + * @example + * ```ts + * type Foo = { a: number; b: string }; + * type Refs = Refs; // { a: Ref; b: Ref } + * type Foo2 = FromRefs; // { a: number; b: string } + * ``` + */ +export type FromRefs = { + [K in keyof T]: T[K] extends Ref ? V : T[K]; +}; diff --git a/packages/codegen-core/src/renderer.d.ts b/packages/codegen-core/src/renderer.d.ts new file mode 100644 index 0000000000..00a704a85f --- /dev/null +++ b/packages/codegen-core/src/renderer.d.ts @@ -0,0 +1,25 @@ +import type { IProjectRenderMeta } from './extensions'; +import type { File } from './files/file'; +import type { IProject } from './project/types'; + +export interface RenderContext { + /** + * The current file. + */ + file: File; + /** + * Arbitrary metadata. + */ + meta?: IProjectRenderMeta; + /** + * The project the file belongs to. + */ + project: IProject; +} + +export interface Renderer { + /** Renders the given file. */ + render(ctx: RenderContext): string; + /** Returns whether this renderer can render the given file. */ + supports(ctx: RenderContext): boolean; +} diff --git a/packages/codegen-core/src/renderer/types.d.ts b/packages/codegen-core/src/renderer/types.d.ts deleted file mode 100644 index 651d28c0cb..0000000000 --- a/packages/codegen-core/src/renderer/types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { IProjectRenderMeta } from '../extensions/types'; -import type { IFileOut } from '../files/types'; -import type { IProject } from '../project/types'; - -export interface IRenderer { - /** - * Renders content with replaced symbols. - * - * @param content Content to render. - * @param file The file to render. - * @param project The parent project the file belongs to. - * @returns Rendered content. - */ - renderFile( - content: string, - file: IFile, - project: IProject, - meta?: IProjectRenderMeta, - ): string; - /** - * Returns printable data containing symbols and exports. - * - * @param file The file to render. - * @param project The parent project the file belongs to. - * @param meta Arbitrary metadata. - * @returns Printable string containing symbols and exports. - */ - renderSymbols( - file: IFileOut, - project: IProject, - meta?: IProjectRenderMeta, - ): string; -} diff --git a/packages/codegen-core/src/renderer/utils.ts b/packages/codegen-core/src/renderer/utils.ts deleted file mode 100644 index 608c07f9f6..0000000000 --- a/packages/codegen-core/src/renderer/utils.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Wraps an ID in namespace to avoid collisions when replacing it. - * - * @param symbolId Stringified symbol ID to use. - * @returns The wrapped placeholder ID. - */ -export const wrapId = (symbolId: string): string => `_heyapi_${symbolId}_`; - -/** - * Unwraps an ID from namespace. - * - * @param wrappedId The wrapped placeholder ID. - * @returns Stringified ID to use. - */ -const unwrapId = (wrappedId: string): string => - wrappedId.slice('_heyapi_'.length, -1); - -/** - * Returns a RegExp instance to match ID placeholders. - * - * @returns RegExp instance to match ID placeholders. - */ -const createPlaceholderRegExp = (): RegExp => new RegExp(wrapId('\\d+'), 'g'); - -/** - * - * @param source The source string to replace. - * @param replacerFn Accepts a symbol ID, returns resolved symbol name. - * @returns The replaced source string. - */ -export const renderIds = ( - source: string, - replacerFn: (symbolId: number) => string | undefined, -): string => - source.replace(createPlaceholderRegExp(), (match) => { - const symbolId = Number.parseInt(unwrapId(match), 10); - return replacerFn(symbolId) || match; - }); diff --git a/packages/codegen-core/src/symbols/registry.ts b/packages/codegen-core/src/symbols/registry.ts index 00a6cd0e7c..c101ea3653 100644 --- a/packages/codegen-core/src/symbols/registry.ts +++ b/packages/codegen-core/src/symbols/registry.ts @@ -1,11 +1,6 @@ -import type { ISymbolMeta } from '../extensions/types'; -import { wrapId } from '../renderer/utils'; -import type { - ISymbolIdentifier, - ISymbolIn, - ISymbolOut, - ISymbolRegistry, -} from './types'; +import type { ISymbolMeta } from '../extensions'; +import { Symbol } from './symbol'; +import type { ISymbolIdentifier, ISymbolIn, ISymbolRegistry } from './types'; type IndexEntry = [string, unknown]; type IndexKeySpace = ReadonlyArray; @@ -14,45 +9,36 @@ type SymbolId = number; export class SymbolRegistry implements ISymbolRegistry { private _id: SymbolId = 0; - private indices: Map>> = + private _indices: Map>> = new Map(); - private nodes: Map = new Map(); - private queryCache: Map> = new Map(); - private queryCacheDependencies: Map> = + private _queryCache: Map> = new Map(); + private _queryCacheDependencies: Map> = new Map(); - private registerOrder: Set = new Set(); - private stubCache: Map = new Map(); - private stubs: Set = new Set(); - private values: Map = new Map(); + private _registered: Set = new Set(); + private _stubs: Set = new Set(); + private _stubCache: Map = new Map(); + private _values: Map = new Map(); - get(identifier: ISymbolIdentifier): ISymbolOut | undefined { + get(identifier: ISymbolIdentifier): Symbol | undefined { return typeof identifier === 'number' - ? this.values.get(identifier) + ? this._values.get(identifier) : this.query(identifier)[0]; } - getValue(symbolId: SymbolId): unknown { - return this.nodes.get(symbolId); - } - - hasValue(symbolId: SymbolId): boolean { - return this.nodes.has(symbolId); + isRegistered(identifier: ISymbolIdentifier): boolean { + const symbol = this.get(identifier); + return symbol ? this._registered.has(symbol.id) : false; } - get id(): SymbolId { + get nextId(): SymbolId { return this._id++; } - isRegistered(identifier: ISymbolIdentifier): boolean { - const symbol = this.get(identifier); - return symbol ? this.registerOrder.has(symbol.id) : false; - } - - query(filter: ISymbolMeta): ReadonlyArray { + query(filter: ISymbolMeta): ReadonlyArray { const cacheKey = this.buildCacheKey(filter); - const cachedIds = this.queryCache.get(cacheKey); + const cachedIds = this._queryCache.get(cacheKey); if (cachedIds) { - return cachedIds.map((symbolId) => this.values.get(symbolId)!); + return cachedIds.map((symbolId) => this._values.get(symbolId)!); } const sets: Array> = []; const indexKeySpace = this.buildIndexKeySpace(filter); @@ -60,7 +46,7 @@ export class SymbolRegistry implements ISymbolRegistry { let missed = false; for (const indexEntry of indexKeySpace) { cacheDependencies.add(this.serializeIndexEntry(indexEntry)); - const values = this.indices.get(indexEntry[0]); + const values = this._indices.get(indexEntry[0]); if (!values) { missed = true; break; @@ -73,8 +59,8 @@ export class SymbolRegistry implements ISymbolRegistry { sets.push(set); } if (missed || !sets.length) { - this.queryCacheDependencies.set(cacheKey, cacheDependencies); - this.queryCache.set(cacheKey, []); + this._queryCacheDependencies.set(cacheKey, cacheDependencies); + this._queryCache.set(cacheKey, []); return []; } let result = new Set(sets[0]); @@ -82,57 +68,49 @@ export class SymbolRegistry implements ISymbolRegistry { result = new Set([...result].filter((symbolId) => set.has(symbolId))); } const resultIds = [...result]; - this.queryCacheDependencies.set(cacheKey, cacheDependencies); - this.queryCache.set(cacheKey, resultIds); - return resultIds.map((symbolId) => this.values.get(symbolId)!); + this._queryCacheDependencies.set(cacheKey, cacheDependencies); + this._queryCache.set(cacheKey, resultIds); + return resultIds.map((symbolId) => this._values.get(symbolId)!); } - reference(meta: ISymbolMeta): ISymbolOut { + reference(meta: ISymbolMeta): Symbol { const [registered] = this.query(meta); if (registered) return registered; + const cacheKey = this.buildCacheKey(meta); - const cachedId = this.stubCache.get(cacheKey); - if (cachedId !== undefined) return this.values.get(cachedId)!; - const id = this.id; - const stub: ISymbolOut = { - id, - meta, - placeholder: wrapId(String(id)), - }; - this.values.set(stub.id, stub); - this.stubs.add(stub.id); - this.stubCache.set(cacheKey, stub.id); + const cachedId = this._stubCache.get(cacheKey); + if (cachedId !== undefined) return this._values.get(cachedId)!; + + const stub = new Symbol({ meta, name: '' }, this.nextId); + + this._values.set(stub.id, stub); + this._stubs.add(stub.id); + this._stubCache.set(cacheKey, stub.id); return stub; } - register(symbol: ISymbolIn): ISymbolOut { - const id = symbol.id !== undefined ? symbol.id : this.id; - const result: ISymbolOut = { - ...symbol, // clone to avoid mutation - id, - placeholder: symbol.placeholder ?? wrapId(String(id)), - }; - this.values.set(result.id, result); - this.registerOrder.add(result.id); + register(symbol: ISymbolIn): Symbol { + const result = new Symbol(symbol, this.nextId); + + this._values.set(result.id, result); + this._registered.add(result.id); + if (result.meta) { const indexKeySpace = this.buildIndexKeySpace(result.meta); this.indexSymbol(result.id, indexKeySpace); this.invalidateCache(indexKeySpace); this.replaceStubs(result, indexKeySpace); } + return result; } - *registered(): IterableIterator { - for (const id of this.registerOrder.values()) { - yield this.values.get(id)!; + *registered(): IterableIterator { + for (const id of this._registered.values()) { + yield this._values.get(id)!; } } - setValue(symbolId: SymbolId, value: unknown): Map { - return this.nodes.set(symbolId, value); - } - private buildCacheKey(filter: ISymbolMeta): QueryCacheKey { const indexKeySpace = this.buildIndexKeySpace(filter); return indexKeySpace @@ -156,8 +134,8 @@ export class SymbolRegistry implements ISymbolRegistry { private indexSymbol(symbolId: SymbolId, indexKeySpace: IndexKeySpace): void { for (const [key, value] of indexKeySpace) { - if (!this.indices.has(key)) this.indices.set(key, new Map()); - const values = this.indices.get(key)!; + if (!this._indices.has(key)) this._indices.set(key, new Map()); + const values = this._indices.get(key)!; const set = values.get(value) ?? new Set(); set.add(symbolId); values.set(value, set); @@ -171,11 +149,11 @@ export class SymbolRegistry implements ISymbolRegistry { for (const [ cacheKey, cacheDependencies, - ] of this.queryCacheDependencies.entries()) { + ] of this._queryCacheDependencies.entries()) { for (const key of changed) { if (cacheDependencies.has(key)) { - this.queryCacheDependencies.delete(cacheKey); - this.queryCache.delete(cacheKey); + this._queryCacheDependencies.delete(cacheKey); + this._queryCache.delete(cacheKey); break; } } @@ -192,17 +170,17 @@ export class SymbolRegistry implements ISymbolRegistry { return true; } - private replaceStubs(symbol: ISymbolOut, indexKeySpace: IndexKeySpace): void { - for (const stubId of this.stubs.values()) { - const stub = this.values.get(stubId); + private replaceStubs(symbol: Symbol, indexKeySpace: IndexKeySpace): void { + for (const stubId of this._stubs.values()) { + const stub = this._values.get(stubId); if ( stub?.meta && this.isSubset(this.buildIndexKeySpace(stub.meta), indexKeySpace) ) { const cacheKey = this.buildCacheKey(stub.meta); - this.stubCache.delete(cacheKey); - this.values.set(stubId, Object.assign(stub, symbol)); - this.stubs.delete(stubId); + this._stubCache.delete(cacheKey); + this._stubs.delete(stubId); + stub.setCanonical(symbol); } } } diff --git a/packages/codegen-core/src/symbols/symbol.ts b/packages/codegen-core/src/symbols/symbol.ts new file mode 100644 index 0000000000..ed285d87c9 --- /dev/null +++ b/packages/codegen-core/src/symbols/symbol.ts @@ -0,0 +1,360 @@ +import { symbolBrand } from '../brands'; +import { debug } from '../debug'; +import type { ISymbolMeta } from '../extensions'; +import type { File } from '../files/file'; +import type { INode } from '../nodes/node'; +import type { + BindingKind, + ISymbolIn, + SymbolKind, + SymbolNameSanitizer, +} from './types'; + +export class Symbol { + /** + * Canonical symbol this stub resolves to, if any. + * + * Stubs created during DSL construction may later be associated + * with a fully registered symbol. Once set, all property lookups + * should defer to the canonical symbol. + */ + private _canonical?: Symbol; + /** + * True if this symbol is exported from its defining file. + * + * @default false + */ + private _exported: boolean; + /** + * Names of files (without extension) from which this symbol is re-exported. + * + * @default [] + */ + private _exportFrom: ReadonlyArray; + /** + * External module name if this symbol is imported from a module not managed + * by the project (e.g. "zod", "lodash"). + * + * @default undefined + */ + private _external?: string; + /** + * The file this symbol is ultimately emitted into. + * + * Only top-level symbols have an assigned file. + */ + private _file?: File; + /** + * The alias-resolved, conflict-free emitted name. + */ + private _finalName?: string; + /** + * Custom strategy to determine file output path. + * + * @returns The file path to output the symbol to, or undefined to fallback to default behavior. + */ + private _getFilePath?: (symbol: Symbol) => string | undefined; + /** + * How this symbol should be imported (namespace/default/named). + * + * @default 'named' + */ + private _importKind: BindingKind; + /** + * Kind of symbol (class, type, alias, etc.). + * + * @default 'var' + */ + private _kind: SymbolKind; + /** + * Arbitrary user metadata. + * + * @default undefined + */ + private _meta?: ISymbolMeta; + /** + * Intended user-facing name before conflict resolution. + * + * @example "UserModel" + */ + private _name: string; + /** + * Optional function to sanitize the symbol name. + * + * @default undefined + */ + private _nameSanitizer?: SymbolNameSanitizer; + /** + * Node that defines this symbol. + */ + private _node?: INode; + + /** Brand used for identifying symbols. */ + readonly '~brand' = symbolBrand; + /** Globally unique, stable symbol ID. */ + readonly id: number; + + constructor(input: ISymbolIn, id: number) { + this._exported = input.exported ?? false; + this._exportFrom = input.exportFrom ?? []; + this._external = input.external; + this._getFilePath = input.getFilePath; + this.id = id; + this._importKind = input.importKind ?? 'named'; + this._kind = input.kind ?? 'var'; + this._meta = input.meta; + this._name = input.name; + } + + /** + * Returns the canonical symbol for this instance. + * + * If this symbol was created as a stub, this getter returns + * the fully registered canonical symbol. Otherwise, it returns + * the symbol itself. + */ + get canonical(): Symbol { + return this._canonical ?? this; + } + + /** + * Indicates whether this symbol is exported from its defining file. + */ + get exported(): boolean { + return this.canonical._exported; + } + + /** + * Names of files (without extension) that re-export this symbol. + */ + get exportFrom(): ReadonlyArray { + return this.canonical._exportFrom; + } + + /** + * External module from which this symbol originates, if any. + */ + get external(): string | undefined { + return this.canonical._external; + } + + /** + * Read‑only accessor for the assigned output file. + * + * Only top-level symbols have an assigned file. + */ + get file(): File | undefined { + return this.canonical._file; + } + + /** + * Read‑only accessor for the resolved final emitted name. + */ + get finalName(): string { + if (!this.canonical._finalName) { + const message = `Symbol finalName has not been resolved yet for ${this.canonical.toString()}`; + debug(message, 'symbol'); + throw new Error(message); + } + return this.canonical._finalName; + } + + /** + * Custom file path resolver, if provided. + */ + get getFilePath(): ((symbol: Symbol) => string | undefined) | undefined { + return this.canonical._getFilePath; + } + + /** + * How this symbol should be imported (named/default/namespace). + */ + get importKind(): BindingKind { + return this.canonical._importKind; + } + + /** + * Indicates whether this is a canonical symbol (not a stub). + */ + get isCanonical(): boolean { + return !this._canonical || this._canonical === this; + } + + /** + * The symbol's kind (class, type, alias, variable, etc.). + */ + get kind(): SymbolKind { + return this.canonical._kind; + } + + /** + * Arbitrary user‑provided metadata associated with this symbol. + */ + get meta(): ISymbolMeta | undefined { + return this.canonical._meta; + } + + /** + * User-intended name before aliasing or conflict resolution. + */ + get name(): string { + return this.canonical._name; + } + + /** + * Optional function to sanitize the symbol name. + */ + get nameSanitizer(): SymbolNameSanitizer | undefined { + return this.canonical._nameSanitizer; + } + + /** + * Read‑only accessor for the defining node. + */ + get node(): INode | undefined { + return this.canonical._node; + } + + /** + * Marks this symbol as a stub and assigns its canonical symbol. + * + * After calling this, all semantic queries (name, kind, file, + * meta, etc.) should reflect the canonical symbol's values. + * + * @param symbol — The canonical symbol this stub should resolve to. + */ + setCanonical(symbol: Symbol): void { + this._canonical = symbol; + } + + /** + * Marks the symbol as exported from its file. + * + * @param exported — Whether the symbol is exported. + */ + setExported(exported: boolean): void { + this.assertCanonical(); + this._exported = exported; + } + + /** + * Records file names that re‑export this symbol. + * + * @param list — Source files re‑exporting this symbol. + */ + setExportFrom(list: ReadonlyArray): void { + this.assertCanonical(); + this._exportFrom = list; + } + + /** + * Assigns the output file this symbol will be emitted into. + * + * This may only be set once. + */ + setFile(file: File): void { + this.assertCanonical(); + if (this._file && this._file !== file) { + const message = `Symbol ${this.canonical.toString()} is already assigned to a different file.`; + debug(message, 'symbol'); + throw new Error(message); + } + this._file = file; + } + + /** + * Assigns the conflict‑resolved final local name for this symbol. + * + * This may only be set once. + */ + setFinalName(name: string): void { + this.assertCanonical(); + if (this._finalName && this._finalName !== name) { + const message = `Symbol finalName has already been resolved for ${this.canonical.toString()}.`; + debug(message, 'symbol'); + throw new Error(message); + } + this._finalName = name; + } + + /** + * Sets how this symbol should be imported. + * + * @param kind — The import strategy (named/default/namespace). + */ + setImportKind(kind: BindingKind): void { + this.assertCanonical(); + this._importKind = kind; + } + + /** + * Sets the symbol's kind (class, type, alias, variable, etc.). + * + * @param kind — The new symbol kind. + */ + setKind(kind: SymbolKind): void { + this.assertCanonical(); + this._kind = kind; + } + + /** + * Updates the intended user‑facing name for this symbol. + * + * @param name — The new name. + */ + setName(name: string): void { + this.assertCanonical(); + this._name = name; + } + + /** + * Sets a custom function to sanitize the symbol's name. + * + * @param fn — The name sanitizer function to apply. + */ + setNameSanitizer(fn: SymbolNameSanitizer): void { + this.assertCanonical(); + this._nameSanitizer = fn; + } + + /** + * Binds the node that defines this symbol. + * + * This may only be set once. + */ + setNode(node: INode): void { + this.assertCanonical(); + if (this._node && this._node !== node) { + const message = `Symbol ${this.canonical.toString()} is already bound to a different node.`; + debug(message, 'symbol'); + throw new Error(message); + } + this._node = node; + node.symbol = this; + } + + /** + * Returns a debug‑friendly string representation identifying the symbol. + */ + toString(): string { + return `[Symbol ${this.name}#${this.id}]`; + } + + /** + * Ensures this symbol is canonical before allowing mutation. + * + * A symbol that has been marked as a stub (i.e., its `_canonical` points + * to a different symbol) may not be mutated. This guard throws an error + * if any setter attempts to modify a stub, preventing accidental writes + * to non‑canonical instances. + * + * @throws {Error} If the symbol is a stub and is being mutated. + */ + private assertCanonical(): void { + if (this._canonical && this._canonical !== this) { + const message = `Illegal mutation of stub symbol ${this.toString()} → canonical: ${this._canonical.toString()}`; + debug(message, 'symbol'); + throw new Error(message); + } + } +} diff --git a/packages/codegen-core/src/symbols/types.d.ts b/packages/codegen-core/src/symbols/types.d.ts index 572a6cd6fd..0243126322 100644 --- a/packages/codegen-core/src/symbols/types.d.ts +++ b/packages/codegen-core/src/symbols/types.d.ts @@ -1,7 +1,21 @@ -import type { ISymbolMeta } from '../extensions/types'; +import type { ISymbolMeta } from '../extensions'; +import type { Symbol } from './symbol'; + +export type BindingKind = 'default' | 'named' | 'namespace'; export type ISymbolIdentifier = number | ISymbolMeta; +export type SymbolKind = + | 'class' + | 'enum' + | 'function' + | 'interface' + | 'namespace' + | 'type' + | 'var'; + +export type SymbolNameSanitizer = (name: string) => string; + export type ISymbolIn = { /** * Array of file names (without extensions) from which this symbol is re-exported. @@ -27,19 +41,15 @@ export type ISymbolIn = { * * @returns The file path to output the symbol to, or undefined to fallback to default behavior. */ - getFilePath?: (symbol: ISymbolOut) => string | undefined; - /** - * Unique symbol ID. If one is not provided, it will be auto-generated. - */ - readonly id?: number; + getFilePath?: Symbol['getFilePath']; /** * Kind of import if this symbol represents an import. */ - importKind?: 'namespace' | 'default' | 'named'; + importKind?: BindingKind; /** * Kind of symbol. */ - kind?: 'class' | 'function' | 'type'; + kind?: SymbolKind; /** * Arbitrary metadata about the symbol. * @@ -47,23 +57,15 @@ export type ISymbolIn = { */ meta?: ISymbolMeta; /** - * The desired name for the symbol within its file. If there are multiple symbols - * with the same desired name, this might not end up being the actual name. + * The intended, user-facing name of the symbol before any conflict resolution. + * It is **not** guaranteed to be the final emitted name — aliasing may occur if the + * file contains conflicting local identifiers or other symbols with the same intended name. * * @example "UserModel" */ - name?: string; - /** - * Placeholder name for the symbol to be replaced later with the final value. - * - * @example "_heyapi_31_" - */ - readonly placeholder?: string; + name: string; }; -export type ISymbolOut = Omit & - Pick, 'id' | 'placeholder'>; - export interface ISymbolRegistry { /** * Get a symbol. @@ -71,48 +73,34 @@ export interface ISymbolRegistry { * @param identifier Symbol identifier to reference. * @returns The symbol, or undefined if not found. */ - get(identifier: ISymbolIdentifier): ISymbolOut | undefined; - /** - * Returns the value associated with a symbol ID. - * - * @param symbolId Symbol ID. - * @return The value associated with the symbol ID, or undefined if not found. - */ - getValue(symbolId: number): unknown; + get(identifier: ISymbolIdentifier): Symbol | undefined; /** - * Checks if the registry has a value associated with a symbol ID. + * Returns whether a symbol is registered in the registry. * - * @param symbolId Symbol ID. - * @returns True if the registry has a value for symbol ID, false otherwise. + * @param identifier Symbol identifier to check. + * @returns True if the symbol is registered, false otherwise. */ - hasValue(symbolId: number): boolean; + isRegistered(identifier: ISymbolIdentifier): boolean; /** * Returns the current symbol ID and increments it. * * @returns Symbol ID before being incremented. */ - readonly id: number; - /** - * Returns whether a symbol is registered in the registry. - * - * @param identifier Symbol identifier to check. - * @returns True if the symbol is registered, false otherwise. - */ - isRegistered(identifier: ISymbolIdentifier): boolean; + readonly nextId: number; /** * Queries symbols by metadata filter. * * @param filter Metadata filter to query symbols by. * @returns Array of symbols matching the filter. */ - query(filter: ISymbolMeta): ReadonlyArray; + query(filter: ISymbolMeta): ReadonlyArray; /** * References a symbol. * * @param meta Metadata filter to reference symbol by. * @returns The referenced symbol. */ - reference(meta: ISymbolMeta): ISymbolOut; + reference(meta: ISymbolMeta): Symbol; /** * Register a symbol globally. * @@ -121,19 +109,11 @@ export interface ISymbolRegistry { * @param symbol Symbol to register. * @returns The registered symbol. */ - register(symbol: ISymbolIn): ISymbolOut; + register(symbol: ISymbolIn): Symbol; /** * Get all symbols in the order they were registered. * * @returns Array of all registered symbols, in insert order. */ - registered(): IterableIterator; - /** - * Sets a value for a symbol by its ID. - * - * @param symbolId Symbol ID. - * @param value The value to set. - * @returns void - */ - setValue(symbolId: number, value: unknown): Map; + registered(): IterableIterator; } diff --git a/packages/codegen-core/tsconfig.base.json b/packages/codegen-core/tsconfig.base.json index 5afc381fb3..23fc135473 100644 --- a/packages/codegen-core/tsconfig.base.json +++ b/packages/codegen-core/tsconfig.base.json @@ -1,6 +1,8 @@ { "compilerOptions": { + "composite": true, "declaration": true, + "declarationMap": true, "esModuleInterop": true, "module": "ESNext", "moduleResolution": "Bundler", diff --git a/packages/codegen-core/tsconfig.json b/packages/codegen-core/tsconfig.json index 89ceb3bfac..2f0d0f5713 100644 --- a/packages/codegen-core/tsconfig.json +++ b/packages/codegen-core/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "declaration": false, "esModuleInterop": true, "resolveJsonModule": true, "skipLibCheck": true diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-false/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-false/index.ts index b43a5238d8..bda139c986 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-false/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-false/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-true/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-true/index.ts index b43a5238d8..388b1ed175 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-true/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/additional-properties-true/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo, Qux } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/index.ts index c352c1047a..de1daea436 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { ClientOptions, PostFooData, PostFooResponse, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-PascalCase/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-PascalCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-PascalCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-camelCase/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-camelCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-camelCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-preserve/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-preserve/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-preserve/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-snake_case/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-snake_case/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-snake_case/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-PascalCase/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-PascalCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-PascalCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-camelCase/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-camelCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-camelCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-const/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-const/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-const/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-const/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-preserve/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-preserve/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-preserve/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-snake_case/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-snake_case/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-snake_case/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values/index.ts index b43a5238d8..50e8edca31 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { _110, Arrays, ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/exclude-deprecated/index.ts index b43a5238d8..542fd104b0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/exclude-deprecated/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/exclude-deprecated/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, Foo, PostFooData, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/external/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/external/index.ts index b43a5238d8..0460b6879f 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/external/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/external/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, ExternalAllOfSchema, ExternalAnyOfSchema, ExternalArraySchema, ExternalDoubleNestedNumeric, ExternalDoubleNestedProp, ExternalMixedProperties, ExternalNestedNumericObjectA, ExternalNestedNumericObjectB, ExternalNestedObjectA, ExternalNestedObjectB, ExternalSchemaA, ExternalSchemaB, ExternalSchemaC, ExternalSchemaExternalProp, ExternalSchemaExternalPropAlias, ExternalSchemaPathA, ExternalSchemaPathB, ExternalSchemaPropertyA, ExternalSchemaPropertyB, ExternalSchemaPropertyC, ExternalSchemaPropertyD, ExternalShared1, ExternalSharedDeep, ExternalSharedExternalNested, ExternalSharedExternalNestedNumeric, ExternalSharedExternalSharedModel, ExternalSharedExternalSharedModelWithUuid, ExternalSharedId, ExternalSharedName, ExternalUnionSchema, GetExternalArrayData, GetExternalArrayResponse, GetExternalArrayResponses, GetExternalMixedData, GetExternalMixedResponse, GetExternalMixedResponses, GetExternalModelData, GetExternalModelError, GetExternalModelErrors, GetExternalModelResponse, GetExternalModelResponses, GetExternalNestedData, GetExternalNestedResponse, GetExternalNestedResponses, GetExternalPropertiesByIdData, GetExternalPropertiesByIdResponse, GetExternalPropertiesByIdResponses, GetExternalUnionData, GetExternalUnionResponses, GetExternalUuidData, GetExternalUuidResponse, GetExternalUuidResponses, PostExternalArrayData, PostExternalArrayResponse, PostExternalArrayResponses, PostExternalMixedData, PostExternalMixedResponse, PostExternalMixedResponses, PostExternalModelData, PostExternalModelErrors, PostExternalModelResponse, PostExternalModelResponses, PostExternalNestedData, PostExternalNestedResponse, PostExternalNestedResponses, PostExternalUnionData, PostExternalUnionResponses, PutExternalUuidData, PutExternalUuidResponse, PutExternalUuidResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/index.ts index c352c1047a..8dc7240b10 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postV1Foo } from './sdk.gen'; +export type { ClientOptions, Foo, PostV1FooData, PostV1FooResponse, PostV1FooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts index c352c1047a..bbab0ca10e 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { Business, Domains, NestedSdkWithInstance, type Options, Providers } from './sdk.gen'; +export type { BusinessGetData, BusinessGetResponse, BusinessGetResponses, BusinessProvidersDomainsGetData, BusinessProvidersDomainsGetResponse, BusinessProvidersDomainsGetResponses, BusinessProvidersDomainsPostData, BusinessProvidersDomainsPostResponse, BusinessProvidersDomainsPostResponses, ClientOptions, GetData, GetResponse, GetResponses, PutBusinessProvidersDomainsData, PutBusinessProvidersDomainsResponse, PutBusinessProvidersDomainsResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts index c352c1047a..19b0bf7f45 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { Business, Domains, Locations, type Options, Providers } from './sdk.gen'; +export type { BusinessGetData, BusinessGetResponse, BusinessGetResponses, BusinessProvidersDomainsGetData, BusinessProvidersDomainsGetResponse, BusinessProvidersDomainsGetResponses, BusinessProvidersDomainsPostData, BusinessProvidersDomainsPostResponse, BusinessProvidersDomainsPostResponses, ClientOptions, GetData, GetResponse, GetResponses, PutBusinessProvidersDomainsData, PutBusinessProvidersDomainsResponse, PutBusinessProvidersDomainsResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/index.ts index c352c1047a..384678da6a 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { Bar, Foo, type Options, Sdk } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts index c352c1047a..8dc6d04993 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { Bar, ClientOptions, Foo, PostFooData, PostFooResponse, PostFooResponses, TypeID, UserId } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts index c352c1047a..8dc6d04993 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { Bar, ClientOptions, Foo, PostFooData, PostFooResponse, PostFooResponses, TypeID, UserId } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts index b43a5238d8..50ec04fec5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Baz, ClientOptions, PostFooReadData, PostFooReadResponse, PostFooReadResponses, QuxAllRead, ReadableBarRead, ReadableCorge, ReadableFooRead, ReadableQuux, WritableBarRead, WritableCorge, WritableFooRead, WritableQuux } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts index b43a5238d8..6544de7b4b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { BarRead, Baz, ClientOptions, Corge, FooRead, PostFooReadData, PostFooReadResponse, PostFooReadResponses, Quux, QuxAllRead } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts index b92ab2076f..3aeed52213 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts @@ -57,10 +57,10 @@ export const getFooQuery = defineQueryOptions((options?: Options) => })); export const fooPostMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.post({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -68,10 +68,10 @@ export const fooPostMutation = (options?: Partial>): UseMut }); export const fooPutMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.put({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -93,10 +93,10 @@ export const getFooBarQuery = defineQueryOptions((options?: Options>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.barService.post({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -104,10 +104,10 @@ export const fooBarPostMutation = (options?: Partial>): }); export const fooBarPutMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.barService.put({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/index.ts index c352c1047a..bb82b04c1c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { BarBazService, BarService, FooBazService, FooService, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts index 7f30f765af..14aff28821 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts @@ -57,10 +57,10 @@ export const serviceWithEmptyTagQuery = defineQueryOptions((options?: Options>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await patchApiVbyApiVersionNoTag({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -68,10 +68,10 @@ export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await fooWow({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -79,10 +79,10 @@ export const fooWowMutation = (options?: Partial>): UseMutat }); export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await deleteCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -104,10 +104,10 @@ export const getCallWithoutParametersAndResponseQuery = defineQueryOptions((opti })); export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await patchCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -115,10 +115,10 @@ export const patchCallWithoutParametersAndResponseMutation = (options?: Partial< }); export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await postCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -126,10 +126,10 @@ export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await putCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -137,10 +137,10 @@ export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithDescriptions({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -148,10 +148,10 @@ export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithParameters({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -159,10 +159,10 @@ export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithWeirdParameterNames({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -184,10 +184,10 @@ export const callWithDefaultParametersQuery = defineQueryOptions((options: Optio })); export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithDefaultOptionalParameters({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -195,10 +195,10 @@ export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callToTestOrderOfParams({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -206,10 +206,10 @@ export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await duplicateName({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -231,10 +231,10 @@ export const duplicateName2Query = defineQueryOptions((options?: Options>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await duplicateName3({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -242,10 +242,10 @@ export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await duplicateName4({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -323,10 +323,10 @@ export const callWithResponseQuery = defineQueryOptions((options?: Options>): UseMutationOptions, CallWithDuplicateResponsesError> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithDuplicateResponses({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -334,10 +334,10 @@ export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, CallWithResponsesError> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithResponses({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -387,10 +387,10 @@ export const complexTypesQuery = defineQueryOptions((options: Options>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithResultFromHeader({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -398,10 +398,10 @@ export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await testErrorCode({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -409,10 +409,10 @@ export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -425,10 +425,10 @@ export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial< * Body should not be unknown */ export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions, PostApiVbyApiVersionBodyError> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await postApiVbyApiVersionBody({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts index c352c1047a..bb82b04c1c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { BarBazService, BarService, FooBazService, FooService, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts index 094d209020..0f0ece7949 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/index.ts index c352c1047a..b3d19ebcdb 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/index.ts index c352c1047a..bb82b04c1c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { BarBazService, BarService, FooBazService, FooService, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts index 094d209020..0f0ece7949 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/index.ts index c352c1047a..b3d19ebcdb 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts index c352c1047a..bb82b04c1c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { BarBazService, BarService, FooBazService, FooService, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts index 094d209020..0f0ece7949 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/index.ts index c352c1047a..b3d19ebcdb 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts index c352c1047a..bb82b04c1c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { BarBazService, BarService, FooBazService, FooService, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts index 094d209020..0f0ece7949 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/index.ts index c352c1047a..b3d19ebcdb 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts index c352c1047a..bb82b04c1c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { BarBazService, BarService, FooBazService, FooService, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts index 094d209020..0f0ece7949 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts index c352c1047a..e45478b1d5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from './sdk.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/index.ts index c352c1047a..b3d19ebcdb 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/index.ts index b43a5238d8..e6075bae2d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, Date, Default, DeleteCallWithoutParametersAndResponseData, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponses, DummyBData, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithStrings, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, FailureFailure, FooWowData, FooWowResponses, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, ModelThatExtends, ModelThatExtendsExtends, ModelWithArray, ModelWithBoolean, ModelWithCircularReference, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithInteger, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableString, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, OptionsCallWithoutParametersAndResponseData, ParameterActivityParams, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyResponses, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ResponsePostActivityResponse, ServiceWithEmptyTagData, SimpleBoolean, SimpleFile, SimpleInteger, SimpleReference, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/types.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/types.gen.ts index d5dadd2914..1723622dc0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/types.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/fastify/default/types.gen.ts @@ -174,7 +174,7 @@ export type DictionaryWithProperties = { /** * This is a type-only model that defines Date as a string */ -export type _Date = string; +export type Date = string; /** * This is a model with one number property diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/index.ts index c352c1047a..f03aa4cba5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, sendEmail } from './sdk.gen'; +export type { Attachment, AttachmentCollection, ClientOptions, HeaderCollection, MessageHeader, SendEmailData, SendEmailError, SendEmailErrors, SendEmailRequest, SendEmailResponse, SendEmailResponse2, SendEmailResponses, StandardPostmarkResponse } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/index.ts index c352c1047a..14b322279b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { getFoo, type Options } from './sdk.gen'; +export type { ClientOptions, GetFooData, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/index.ts index c352c1047a..14b322279b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { getFoo, type Options } from './sdk.gen'; +export type { ClientOptions, GetFooData, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/index.ts index c352c1047a..14b322279b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { getFoo, type Options } from './sdk.gen'; +export type { ClientOptions, GetFooData, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/index.ts index c352c1047a..14b322279b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { getFoo, type Options } from './sdk.gen'; +export type { ClientOptions, GetFooData, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/index.ts index b43a5238d8..f389f85547 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/index.ts index b43a5238d8..f389f85547 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/index.ts index b43a5238d8..f389f85547 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/index.ts index b43a5238d8..72df6eb051 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { BarRead, BarReadWritable, Baz, ClientOptions, Corge, CorgeWritable, FooRead, FooReadWritable, PostFooReadData, PostFooReadResponse, PostFooReadResponses, Quux, QuuxWritable, QuxAllRead } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-false/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-false/index.ts index b43a5238d8..bda139c986 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-false/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-false/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-true/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-true/index.ts index b43a5238d8..388b1ed175 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-true/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-true/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo, Qux } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-undefined/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-undefined/index.ts index b43a5238d8..555bf9ff25 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-undefined/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/additional-properties-undefined/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, Foo } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-items-one-of-length-1/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-items-one-of-length-1/index.ts index b43a5238d8..757bc07b7a 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-items-one-of-length-1/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-items-one-of-length-1/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, ClientOptions, Foo } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-nested-one-of/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-nested-one-of/index.ts index b43a5238d8..555bf9ff25 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-nested-one-of/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/array-nested-one-of/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, Foo } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/index.ts index c352c1047a..de1daea436 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { ClientOptions, PostFooData, PostFooResponse, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-PascalCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-PascalCase/index.ts index b43a5238d8..46bcc346fa 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-PascalCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-PascalCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { _201, ClientOptions, Foo, FooBar, FooBar2, FooBar3, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-camelCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-camelCase/index.ts index b43a5238d8..ccff152fd8 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-camelCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-camelCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { _201, clientOptions, foo, fooBar, fooBar2, fooBar3, getFooData, getFooResponse, getFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-preserve/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-preserve/index.ts index b43a5238d8..9f42252a34 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-preserve/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-preserve/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { _201, ClientOptions, Foo, foo_bar, fooBar, FooBar, getFooData, getFooResponse, getFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-snake_case/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-snake_case/index.ts index b43a5238d8..ca6918055d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-snake_case/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/case-snake_case/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { _201, client_options, foo, foo_bar, foo_bar2, foo_bar3, get_foo_data, get_foo_response, get_foo_responses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/components-request-bodies/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/components-request-bodies/index.ts index b43a5238d8..542fd104b0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/components-request-bodies/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/components-request-bodies/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, Foo, PostFooData, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-binary/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-binary/index.ts index b43a5238d8..79c8f10876 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-binary/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-binary/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, GetBarData, GetBarResponse, GetBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/index.ts index c352c1047a..b8bd9b3081 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { getFoo, type Options } from './sdk.gen'; +export type { ClientOptions, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-all-of/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-all-of/index.ts index b43a5238d8..4d5281fcf2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-all-of/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-all-of/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, BarMapped, BarUnion, Baz, BazMapped, BazUnion, ClientOptions, Foo, FooMapped, FooUnion, Qux, QuxExtend, QuxMapped } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-any-of/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-any-of/index.ts index b43a5238d8..8bc58ce115 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-any-of/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-any-of/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo, Quux, Quuz, Qux, Spæcial } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-mapped-many/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-mapped-many/index.ts index b43a5238d8..85bc1ce95f 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-mapped-many/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-mapped-many/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo, Spæcial } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-one-of/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-one-of/index.ts index b43a5238d8..8bc58ce115 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-one-of/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-one-of/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo, Quux, Quuz, Qux, Spæcial } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-escape/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-escape/index.ts index b43a5238d8..757bc07b7a 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-escape/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-escape/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, ClientOptions, Foo } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-javascript/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-javascript/index.ts index 0339b6e31e..6576970b83 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-javascript/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-javascript/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { type ClientOptions, type Foo, TypeEnum } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-typescript/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-typescript/index.ts index 0339b6e31e..6576970b83 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-typescript/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline-typescript/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { type ClientOptions, type Foo, TypeEnum } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline/index.ts index b43a5238d8..33293d319f 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-inline/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, Foo, TypeEnum } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-PascalCase/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-PascalCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-PascalCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-camelCase/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-camelCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-camelCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-ignore-null/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-ignore-null/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-ignore-null/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-ignore-null/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-preserve/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-preserve/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-preserve/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-snake_case/index.ts index 0339b6e31e..e6f33b03a0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-snake_case/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-javascript-snake_case/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, Arrays, type ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-PascalCase/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-PascalCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-PascalCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-camelCase/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-camelCase/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-camelCase/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-const/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-const/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-const/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-const/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-preserve/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-preserve/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-preserve/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-snake_case/index.ts index 0339b6e31e..76ebfd28c9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-snake_case/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values-typescript-snake_case/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; +export { _110, type Arrays, type ClientOptions, type Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values/index.ts index b43a5238d8..50e8edca31 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-names-values/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { _110, Arrays, ClientOptions, Foo, MyFoo, MyFoo2, Numbers } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-null/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-null/index.ts index b43a5238d8..bda139c986 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-null/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/enum-null/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Bar, Baz, ClientOptions, Foo } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/exclude-deprecated/index.ts index b43a5238d8..542fd104b0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/exclude-deprecated/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/exclude-deprecated/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, Foo, PostFooData, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/external/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/external/index.ts index b43a5238d8..148e0ddb86 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/external/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/external/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, ExternalAllOfSchema, ExternalAnyOfSchema, ExternalArraySchema, ExternalDeepParam, ExternalDoubleNestedNumeric, ExternalDoubleNestedProp, ExternalIdParam, ExternalMixedBody, ExternalMixedProperties, ExternalModelBody, ExternalNestedBody, ExternalNestedNumericObjectA, ExternalNestedNumericObjectB, ExternalNestedObjectA, ExternalNestedObjectB, ExternalNumericParam, ExternalSchemaA, ExternalSchemaB, ExternalSchemaC, ExternalSchemaExternalProp, ExternalSchemaExternalPropAlias, ExternalSchemaPathA, ExternalSchemaPathB, ExternalSchemaPropertyA, ExternalSchemaPropertyB, ExternalSchemaPropertyC, ExternalSchemaPropertyD, ExternalShared1, ExternalSharedDeep, ExternalSharedExternalNested, ExternalSharedExternalNestedNumeric, ExternalSharedExternalSharedModel, ExternalSharedExternalSharedModelWithUuid, ExternalSharedId, ExternalSharedName, ExternalUnionSchema, ExternalUuidBody, ExternalUuidParam, GetExternalArrayData, GetExternalArrayResponse, GetExternalArrayResponses, GetExternalMixedData, GetExternalMixedResponse, GetExternalMixedResponses, GetExternalModelData, GetExternalModelError, GetExternalModelErrors, GetExternalModelResponse, GetExternalModelResponses, GetExternalNestedData, GetExternalNestedResponse, GetExternalNestedResponses, GetExternalPropertiesByIdData, GetExternalPropertiesByIdResponse, GetExternalPropertiesByIdResponses, GetExternalUnionData, GetExternalUnionResponse, GetExternalUnionResponses, GetExternalUuidData, GetExternalUuidResponse, GetExternalUuidResponses, PostExternalArrayData, PostExternalArrayResponse, PostExternalArrayResponses, PostExternalMixedData, PostExternalMixedResponse, PostExternalMixedResponses, PostExternalModelData, PostExternalModelError, PostExternalModelErrors, PostExternalModelResponse, PostExternalModelResponses, PostExternalNestedData, PostExternalNestedResponse, PostExternalNestedResponses, PostExternalUnionData, PostExternalUnionResponse, PostExternalUnionResponses, PutExternalUuidData, PutExternalUuidResponse, PutExternalUuidResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/index.ts index c352c1047a..56a7906964 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { create, create2, create3, type Options } from './sdk.gen'; +export type { ClientOptions, Create2Data, Create2Responses, Create3Data, Create3Responses, CreateData, CreateResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/operation-204/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/operation-204/index.ts index b43a5238d8..70ba29e143 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/operation-204/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/operation-204/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { ClientOptions, PostFooData, PostFooResponse, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/index.ts index c352c1047a..878d240fe5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { ClientOptions, PostFooData, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/index.ts index c352c1047a..878d240fe5 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { ClientOptions, PostFooData, PostFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/index.ts index c352c1047a..62e4bbff0b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from './sdk.gen'; +export type { _3eNum1Период, _400, AdditionalPropertiesIntegerIssue, AdditionalPropertiesUnknownIssue, AdditionalPropertiesUnknownIssue2, AdditionalPropertiesUnknownIssue3, AdditionalPropertiesUnknownIssueWritable, AnyOfAnyAndNull, AnyOfArrays, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, ApiVVersionODataControllerCountResponses, ArrayWithAnyOfProperties, ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, CamelCaseCommentWithBreaks, CharactersInDescription, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexParamsData, ComplexParamsResponse, ComplexParamsResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, CompositionBaseModel, CompositionExtendedModel, CompositionWithAllOfAndNullable, CompositionWithAnyOf, CompositionWithAnyOfAndNullable, CompositionWithAnyOfAnonymous, CompositionWithNestedAnyAndTypeNull, CompositionWithNestedAnyOfAndNull, CompositionWithOneOf, CompositionWithOneOfAndComplexArrayDictionary, CompositionWithOneOfAndNullable, CompositionWithOneOfAndProperties, CompositionWithOneOfAndSimpleArrayDictionary, CompositionWithOneOfAndSimpleDictionary, CompositionWithOneOfAnonymous, CompositionWithOneOfDiscriminator, ConstValue, Default, DeleteCallWithoutParametersAndResponseData, DeleteFooData, DeleteFooData2, DeleteFooData3, DeprecatedCallData, DeprecatedModel, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithPropertiesAndAdditionalProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponse, DummyAResponses, DummyBData, DummyBResponse, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithReplacedCharacters, EnumWithStrings, EnumWithXEnumNames, ExportData, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, File, FileResponseData, FileResponseResponse, FileResponseResponses, FileWritable, FooWowData, FooWowResponses, FreeFormObjectWithAdditionalPropertiesEqEmptyObject, FreeFormObjectWithAdditionalPropertiesEqTrue, FreeFormObjectWithoutAdditionalProperties, GenericSchemaDuplicateIssue1SystemBoolean, GenericSchemaDuplicateIssue1SystemBooleanWritable, GenericSchemaDuplicateIssue1SystemString, GenericSchemaDuplicateIssue1SystemStringWritable, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationErrors, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationResponses, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, Import, ImportData, ImportResponse, ImportResponses, IoK8sApimachineryPkgApisMetaV1DeleteOptions, IoK8sApimachineryPkgApisMetaV1Preconditions, ModelCircle, ModelFromZendesk, ModelSquare, ModelThatExtends, ModelThatExtendsExtends, ModelWithAdditionalPropertiesEqTrue, ModelWithAnyOfConstantSizeArray, ModelWithAnyOfConstantSizeArrayAndIntersect, ModelWithAnyOfConstantSizeArrayNullable, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritable, ModelWithArray, ModelWithArrayReadOnlyAndWriteOnly, ModelWithArrayReadOnlyAndWriteOnlyWritable, ModelWithBackticksInDescription, ModelWithBoolean, ModelWithCircularReference, ModelWithConst, ModelWithConstantSizeArray, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithEnumWithHyphen, ModelWithInteger, ModelWithNestedArrayEnums, ModelWithNestedArrayEnumsData, ModelWithNestedArrayEnumsDataBar, ModelWithNestedArrayEnumsDataFoo, ModelWithNestedCompositionEnums, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableObject, ModelWithNullableString, ModelWithNumericEnumUnion, ModelWithOneOfAndProperties, ModelWithOneOfEnum, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithPrefixItemsConstantSizeArray, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReadOnlyAndWriteOnly, ModelWithReadOnlyAndWriteOnlyWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, MultipartResponseResponses, NestedAnyOfArraysNullable, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, NullableObject, OneOfAllOfIssue, OneOfAllOfIssueWritable, OptionsCallWithoutParametersAndResponseData, Pageable, ParameterSimpleParameterUnused, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithOptionalParamResponses, PostCallWithoutParametersAndResponseData, PostServiceWithEmptyTagResponse, PostServiceWithEmptyTagResponse2, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, SchemaWithFormRestrictedKeys, SimpleBoolean, SimpleFile, SimpleFormData, SimpleInteger, SimpleParameter, SimpleReference, SimpleRequestBody, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses, UploadFileData, UploadFileResponse, UploadFileResponses, XFooBar } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/index.ts index c352c1047a..62e4bbff0b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from './sdk.gen'; +export type { _3eNum1Период, _400, AdditionalPropertiesIntegerIssue, AdditionalPropertiesUnknownIssue, AdditionalPropertiesUnknownIssue2, AdditionalPropertiesUnknownIssue3, AdditionalPropertiesUnknownIssueWritable, AnyOfAnyAndNull, AnyOfArrays, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, ApiVVersionODataControllerCountResponses, ArrayWithAnyOfProperties, ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, CamelCaseCommentWithBreaks, CharactersInDescription, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexParamsData, ComplexParamsResponse, ComplexParamsResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, CompositionBaseModel, CompositionExtendedModel, CompositionWithAllOfAndNullable, CompositionWithAnyOf, CompositionWithAnyOfAndNullable, CompositionWithAnyOfAnonymous, CompositionWithNestedAnyAndTypeNull, CompositionWithNestedAnyOfAndNull, CompositionWithOneOf, CompositionWithOneOfAndComplexArrayDictionary, CompositionWithOneOfAndNullable, CompositionWithOneOfAndProperties, CompositionWithOneOfAndSimpleArrayDictionary, CompositionWithOneOfAndSimpleDictionary, CompositionWithOneOfAnonymous, CompositionWithOneOfDiscriminator, ConstValue, Default, DeleteCallWithoutParametersAndResponseData, DeleteFooData, DeleteFooData2, DeleteFooData3, DeprecatedCallData, DeprecatedModel, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithPropertiesAndAdditionalProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponse, DummyAResponses, DummyBData, DummyBResponse, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithReplacedCharacters, EnumWithStrings, EnumWithXEnumNames, ExportData, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, File, FileResponseData, FileResponseResponse, FileResponseResponses, FileWritable, FooWowData, FooWowResponses, FreeFormObjectWithAdditionalPropertiesEqEmptyObject, FreeFormObjectWithAdditionalPropertiesEqTrue, FreeFormObjectWithoutAdditionalProperties, GenericSchemaDuplicateIssue1SystemBoolean, GenericSchemaDuplicateIssue1SystemBooleanWritable, GenericSchemaDuplicateIssue1SystemString, GenericSchemaDuplicateIssue1SystemStringWritable, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationErrors, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationResponses, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, Import, ImportData, ImportResponse, ImportResponses, IoK8sApimachineryPkgApisMetaV1DeleteOptions, IoK8sApimachineryPkgApisMetaV1Preconditions, ModelCircle, ModelFromZendesk, ModelSquare, ModelThatExtends, ModelThatExtendsExtends, ModelWithAdditionalPropertiesEqTrue, ModelWithAnyOfConstantSizeArray, ModelWithAnyOfConstantSizeArrayAndIntersect, ModelWithAnyOfConstantSizeArrayNullable, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritable, ModelWithArray, ModelWithArrayReadOnlyAndWriteOnly, ModelWithArrayReadOnlyAndWriteOnlyWritable, ModelWithBackticksInDescription, ModelWithBoolean, ModelWithCircularReference, ModelWithConst, ModelWithConstantSizeArray, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithEnumWithHyphen, ModelWithInteger, ModelWithNestedArrayEnums, ModelWithNestedArrayEnumsData, ModelWithNestedArrayEnumsDataBar, ModelWithNestedArrayEnumsDataFoo, ModelWithNestedCompositionEnums, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableObject, ModelWithNullableString, ModelWithNumericEnumUnion, ModelWithOneOfAndProperties, ModelWithOneOfEnum, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithPrefixItemsConstantSizeArray, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReadOnlyAndWriteOnly, ModelWithReadOnlyAndWriteOnlyWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, MultipartResponseResponses, NestedAnyOfArraysNullable, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, NullableObject, OneOfAllOfIssue, OneOfAllOfIssueWritable, OptionsCallWithoutParametersAndResponseData, Pageable, ParameterSimpleParameterUnused, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithOptionalParamResponses, PostCallWithoutParametersAndResponseData, PostServiceWithEmptyTagResponse, PostServiceWithEmptyTagResponse2, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, SchemaWithFormRestrictedKeys, SimpleBoolean, SimpleFile, SimpleFormData, SimpleInteger, SimpleParameter, SimpleReference, SimpleRequestBody, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses, UploadFileData, UploadFileResponse, UploadFileResponses, XFooBar } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts index c352c1047a..bbab0ca10e 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { Business, Domains, NestedSdkWithInstance, type Options, Providers } from './sdk.gen'; +export type { BusinessGetData, BusinessGetResponse, BusinessGetResponses, BusinessProvidersDomainsGetData, BusinessProvidersDomainsGetResponse, BusinessProvidersDomainsGetResponses, BusinessProvidersDomainsPostData, BusinessProvidersDomainsPostResponse, BusinessProvidersDomainsPostResponses, ClientOptions, GetData, GetResponse, GetResponses, PutBusinessProvidersDomainsData, PutBusinessProvidersDomainsResponse, PutBusinessProvidersDomainsResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts index c352c1047a..19b0bf7f45 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { Business, Domains, Locations, type Options, Providers } from './sdk.gen'; +export type { BusinessGetData, BusinessGetResponse, BusinessGetResponses, BusinessProvidersDomainsGetData, BusinessProvidersDomainsGetResponse, BusinessProvidersDomainsGetResponses, BusinessProvidersDomainsPostData, BusinessProvidersDomainsPostResponse, BusinessProvidersDomainsPostResponses, ClientOptions, GetData, GetResponse, GetResponses, PutBusinessProvidersDomainsData, PutBusinessProvidersDomainsResponse, PutBusinessProvidersDomainsResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/index.ts index c352c1047a..62e4bbff0b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from './sdk.gen'; +export type { _3eNum1Период, _400, AdditionalPropertiesIntegerIssue, AdditionalPropertiesUnknownIssue, AdditionalPropertiesUnknownIssue2, AdditionalPropertiesUnknownIssue3, AdditionalPropertiesUnknownIssueWritable, AnyOfAnyAndNull, AnyOfArrays, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, ApiVVersionODataControllerCountResponses, ArrayWithAnyOfProperties, ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, CamelCaseCommentWithBreaks, CharactersInDescription, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexParamsData, ComplexParamsResponse, ComplexParamsResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, CompositionBaseModel, CompositionExtendedModel, CompositionWithAllOfAndNullable, CompositionWithAnyOf, CompositionWithAnyOfAndNullable, CompositionWithAnyOfAnonymous, CompositionWithNestedAnyAndTypeNull, CompositionWithNestedAnyOfAndNull, CompositionWithOneOf, CompositionWithOneOfAndComplexArrayDictionary, CompositionWithOneOfAndNullable, CompositionWithOneOfAndProperties, CompositionWithOneOfAndSimpleArrayDictionary, CompositionWithOneOfAndSimpleDictionary, CompositionWithOneOfAnonymous, CompositionWithOneOfDiscriminator, ConstValue, Default, DeleteCallWithoutParametersAndResponseData, DeleteFooData, DeleteFooData2, DeleteFooData3, DeprecatedCallData, DeprecatedModel, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithPropertiesAndAdditionalProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponse, DummyAResponses, DummyBData, DummyBResponse, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithReplacedCharacters, EnumWithStrings, EnumWithXEnumNames, ExportData, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, File, FileResponseData, FileResponseResponse, FileResponseResponses, FileWritable, FooWowData, FooWowResponses, FreeFormObjectWithAdditionalPropertiesEqEmptyObject, FreeFormObjectWithAdditionalPropertiesEqTrue, FreeFormObjectWithoutAdditionalProperties, GenericSchemaDuplicateIssue1SystemBoolean, GenericSchemaDuplicateIssue1SystemBooleanWritable, GenericSchemaDuplicateIssue1SystemString, GenericSchemaDuplicateIssue1SystemStringWritable, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationErrors, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationResponses, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, Import, ImportData, ImportResponse, ImportResponses, IoK8sApimachineryPkgApisMetaV1DeleteOptions, IoK8sApimachineryPkgApisMetaV1Preconditions, ModelCircle, ModelFromZendesk, ModelSquare, ModelThatExtends, ModelThatExtendsExtends, ModelWithAdditionalPropertiesEqTrue, ModelWithAnyOfConstantSizeArray, ModelWithAnyOfConstantSizeArrayAndIntersect, ModelWithAnyOfConstantSizeArrayNullable, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritable, ModelWithArray, ModelWithArrayReadOnlyAndWriteOnly, ModelWithArrayReadOnlyAndWriteOnlyWritable, ModelWithBackticksInDescription, ModelWithBoolean, ModelWithCircularReference, ModelWithConst, ModelWithConstantSizeArray, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithEnumWithHyphen, ModelWithInteger, ModelWithNestedArrayEnums, ModelWithNestedArrayEnumsData, ModelWithNestedArrayEnumsDataBar, ModelWithNestedArrayEnumsDataFoo, ModelWithNestedCompositionEnums, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableObject, ModelWithNullableString, ModelWithNumericEnumUnion, ModelWithOneOfAndProperties, ModelWithOneOfEnum, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithPrefixItemsConstantSizeArray, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReadOnlyAndWriteOnly, ModelWithReadOnlyAndWriteOnlyWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, MultipartResponseResponses, NestedAnyOfArraysNullable, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, NullableObject, OneOfAllOfIssue, OneOfAllOfIssueWritable, OptionsCallWithoutParametersAndResponseData, Pageable, ParameterSimpleParameterUnused, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithOptionalParamResponses, PostCallWithoutParametersAndResponseData, PostServiceWithEmptyTagResponse, PostServiceWithEmptyTagResponse2, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, SchemaWithFormRestrictedKeys, SimpleBoolean, SimpleFile, SimpleFormData, SimpleInteger, SimpleParameter, SimpleReference, SimpleRequestBody, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses, UploadFileData, UploadFileResponse, UploadFileResponses, XFooBar } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/index.ts index c352c1047a..384678da6a 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { Bar, Foo, type Options, Sdk } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts index c352c1047a..62e4bbff0b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, headCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, optionsCallWithoutParametersAndResponse, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from './sdk.gen'; +export type { _3eNum1Период, _400, AdditionalPropertiesIntegerIssue, AdditionalPropertiesUnknownIssue, AdditionalPropertiesUnknownIssue2, AdditionalPropertiesUnknownIssue3, AdditionalPropertiesUnknownIssueWritable, AnyOfAnyAndNull, AnyOfArrays, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, ApiVVersionODataControllerCountResponses, ArrayWithAnyOfProperties, ArrayWithArray, ArrayWithBooleans, ArrayWithNumbers, ArrayWithProperties, ArrayWithReferences, ArrayWithStrings, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesResponses, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithNoContentResponseResponses, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseAndNoContentResponseResponses, CallWithResponseData, CallWithResponseResponse, CallWithResponseResponses, CallWithResponsesData, CallWithResponsesError, CallWithResponsesErrors, CallWithResponsesResponse, CallWithResponsesResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, CallWithWeirdParameterNamesData, CamelCaseCommentWithBreaks, CharactersInDescription, ClientOptions, CollectionFormatData, CommentWithBackticks, CommentWithBackticksAndQuotes, CommentWithBreaks, CommentWithExpressionPlaceholders, CommentWithQuotes, CommentWithReservedCharacters, CommentWithSlashes, ComplexParamsData, ComplexParamsResponse, ComplexParamsResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponse, ComplexTypesResponses, CompositionBaseModel, CompositionExtendedModel, CompositionWithAllOfAndNullable, CompositionWithAnyOf, CompositionWithAnyOfAndNullable, CompositionWithAnyOfAnonymous, CompositionWithNestedAnyAndTypeNull, CompositionWithNestedAnyOfAndNull, CompositionWithOneOf, CompositionWithOneOfAndComplexArrayDictionary, CompositionWithOneOfAndNullable, CompositionWithOneOfAndProperties, CompositionWithOneOfAndSimpleArrayDictionary, CompositionWithOneOfAndSimpleDictionary, CompositionWithOneOfAnonymous, CompositionWithOneOfDiscriminator, ConstValue, Default, DeleteCallWithoutParametersAndResponseData, DeleteFooData, DeleteFooData2, DeleteFooData3, DeprecatedCallData, DeprecatedModel, DictionaryWithArray, DictionaryWithDictionary, DictionaryWithProperties, DictionaryWithPropertiesAndAdditionalProperties, DictionaryWithReference, DictionaryWithString, DummyAData, DummyAResponse, DummyAResponses, DummyBData, DummyBResponse, DummyBResponses, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, EnumFromDescription, EnumWithExtensions, EnumWithNumbers, EnumWithReplacedCharacters, EnumWithStrings, EnumWithXEnumNames, ExportData, ExternalRefA, ExternalRefB, ExternalSharedExternalSharedModel, File, FileResponseData, FileResponseResponse, FileResponseResponses, FileWritable, FooWowData, FooWowResponses, FreeFormObjectWithAdditionalPropertiesEqEmptyObject, FreeFormObjectWithAdditionalPropertiesEqTrue, FreeFormObjectWithoutAdditionalProperties, GenericSchemaDuplicateIssue1SystemBoolean, GenericSchemaDuplicateIssue1SystemBooleanWritable, GenericSchemaDuplicateIssue1SystemString, GenericSchemaDuplicateIssue1SystemStringWritable, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationErrors, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationResponses, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, Import, ImportData, ImportResponse, ImportResponses, IoK8sApimachineryPkgApisMetaV1DeleteOptions, IoK8sApimachineryPkgApisMetaV1Preconditions, ModelCircle, ModelFromZendesk, ModelSquare, ModelThatExtends, ModelThatExtendsExtends, ModelWithAdditionalPropertiesEqTrue, ModelWithAnyOfConstantSizeArray, ModelWithAnyOfConstantSizeArrayAndIntersect, ModelWithAnyOfConstantSizeArrayNullable, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions, ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritable, ModelWithArray, ModelWithArrayReadOnlyAndWriteOnly, ModelWithArrayReadOnlyAndWriteOnlyWritable, ModelWithBackticksInDescription, ModelWithBoolean, ModelWithCircularReference, ModelWithConst, ModelWithConstantSizeArray, ModelWithDictionary, ModelWithDuplicateImports, ModelWithDuplicateProperties, ModelWithEnum, ModelWithEnumFromDescription, ModelWithEnumWithHyphen, ModelWithInteger, ModelWithNestedArrayEnums, ModelWithNestedArrayEnumsData, ModelWithNestedArrayEnumsDataBar, ModelWithNestedArrayEnumsDataFoo, ModelWithNestedCompositionEnums, ModelWithNestedEnums, ModelWithNestedProperties, ModelWithNullableObject, ModelWithNullableString, ModelWithNumericEnumUnion, ModelWithOneOfAndProperties, ModelWithOneOfEnum, ModelWithOrderedProperties, ModelWithPattern, ModelWithPatternWritable, ModelWithPrefixItemsConstantSizeArray, ModelWithProperties, ModelWithPropertiesWritable, ModelWithReadOnlyAndWriteOnly, ModelWithReadOnlyAndWriteOnlyWritable, ModelWithReference, ModelWithReferenceWritable, ModelWithString, ModelWithStringError, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, MultipartResponseResponses, NestedAnyOfArraysNullable, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, NonAsciiæøåÆøÅöôêÊ字符串Responses, NonAsciiStringæøåÆøÅöôêÊ字符串, NullableObject, OneOfAllOfIssue, OneOfAllOfIssueWritable, OptionsCallWithoutParametersAndResponseData, Pageable, ParameterSimpleParameterUnused, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithOptionalParamResponses, PostCallWithoutParametersAndResponseData, PostServiceWithEmptyTagResponse, PostServiceWithEmptyTagResponse2, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, SchemaWithFormRestrictedKeys, SimpleBoolean, SimpleFile, SimpleFormData, SimpleInteger, SimpleParameter, SimpleReference, SimpleRequestBody, SimpleString, SimpleStringWithPattern, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, TypesData, TypesResponse, TypesResponses, UploadFileData, UploadFileResponse, UploadFileResponses, XFooBar } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts index c352c1047a..8dc6d04993 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { Bar, ClientOptions, Foo, PostFooData, PostFooResponse, PostFooResponses, TypeID, UserId } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts index c352c1047a..8dc6d04993 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { type Options, postFoo } from './sdk.gen'; +export type { Bar, ClientOptions, Foo, PostFooData, PostFooResponse, PostFooResponses, TypeID, UserId } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts index b43a5238d8..4eb140e608 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { Baz, ClientOptions, PostFooReadData, PostFooReadResponse, PostFooReadResponses, PostFooReadWriteData, PostFooReadWriteResponse, PostFooReadWriteResponses, PostFooWriteData, PostFooWriteResponse, PostFooWriteResponses, QuxAllRead, ReadableBarRead, ReadableBarWrite, ReadableCorge, ReadableFooRead, ReadableFooReadWrite, ReadableFooWrite, ReadableQuux, WritableBarRead, WritableBarWrite, WritableCorge, WritableFooRead, WritableFooReadWrite, WritableFooWrite, WritableQuux } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts index b43a5238d8..f3f644d9a9 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/index.ts @@ -1,3 +1,3 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export type { BarRead, BarWrite, Baz, ClientOptions, Corge, FooRead, FooReadWrite, FooWrite, PostFooReadData, PostFooReadResponse, PostFooReadResponses, PostFooReadWriteData, PostFooReadWriteResponse, PostFooReadWriteResponses, PostFooWriteData, PostFooWriteResponse, PostFooWriteResponses, Quux, QuxAllRead } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts index b92ab2076f..3aeed52213 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts @@ -57,10 +57,10 @@ export const getFooQuery = defineQueryOptions((options?: Options) => })); export const fooPostMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.post({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -68,10 +68,10 @@ export const fooPostMutation = (options?: Partial>): UseMut }); export const fooPutMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.put({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -93,10 +93,10 @@ export const getFooBarQuery = defineQueryOptions((options?: Options>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.barService.post({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -104,10 +104,10 @@ export const fooBarPostMutation = (options?: Partial>): }); export const fooBarPutMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await FooBazService.fooService.barService.put({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/index.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/index.ts index c352c1047a..bb82b04c1c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/index.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; -export * from './sdk.gen'; +export { BarBazService, BarService, FooBazService, FooService, type Options } from './sdk.gen'; +export type { ClientOptions, FooBarPostData, FooBarPostResponse, FooBarPostResponses, FooBarPutData, FooBarPutResponse, FooBarPutResponses, FooPostData, FooPostResponse, FooPostResponses, FooPutData, FooPutResponse, FooPutResponses, GetFooBarData, GetFooBarResponse, GetFooBarResponses, GetFooData, GetFooResponse, GetFooResponses } from './types.gen'; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts index 7bcd0d40e0..81651e8f98 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts @@ -57,10 +57,10 @@ export const exportQuery = defineQueryOptions((options?: Options) => })); export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await patchApiVbyApiVersionNoTag({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -68,10 +68,10 @@ export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await import_({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -79,10 +79,10 @@ export const importMutation = (options?: Partial>): UseMutat }); export const fooWowMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await fooWow({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -118,10 +118,10 @@ export const getApiVbyApiVersionSimpleOperationQuery = defineQueryOptions((optio })); export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await deleteCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -143,10 +143,10 @@ export const getCallWithoutParametersAndResponseQuery = defineQueryOptions((opti })); export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await patchCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -154,10 +154,10 @@ export const patchCallWithoutParametersAndResponseMutation = (options?: Partial< }); export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await postCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -165,10 +165,10 @@ export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await putCallWithoutParametersAndResponse({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -176,10 +176,10 @@ export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await deleteFoo({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -187,10 +187,10 @@ export const deleteFooMutation = (options?: Partial>): U }); export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithDescriptions({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -201,10 +201,10 @@ export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await deprecatedCall({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -212,10 +212,10 @@ export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithParameters({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -223,10 +223,10 @@ export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await callWithWeirdParameterNames({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -248,10 +248,10 @@ export const getCallWithOptionalParamQuery = defineQueryOptions((options: Option })); export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await postCallWithOptionalParam({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -259,10 +259,10 @@ export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Error> => ({ - mutation: async (fnOptions) => { + mutation: async (vars) => { const { data } = await postApiVbyApiVersionRequestBody({ ...options, - ...fnOptions, + ...vars, throwOnError: true }); return data; @@ -270,10 +270,10 @@ export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial